Package net.bytebuddy.implementation
Class MethodCall.TargetHandler.Simple
java.lang.Object
net.bytebuddy.implementation.MethodCall.TargetHandler.Simple
- All Implemented Interfaces:
InstrumentedType.Prepareable,MethodCall.TargetHandler,MethodCall.TargetHandler.Factory,MethodCall.TargetHandler.Resolved
- Enclosing interface:
MethodCall.TargetHandler
@Enhance
public static class MethodCall.TargetHandler.Simple
extends Object
implements MethodCall.TargetHandler, MethodCall.TargetHandler.Factory, MethodCall.TargetHandler.Resolved
A simple target handler that applies a given stack manipulation.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable
InstrumentedType.Prepareable.NoOpNested classes/interfaces inherited from interface net.bytebuddy.implementation.MethodCall.TargetHandler
MethodCall.TargetHandler.Factory, MethodCall.TargetHandler.ForConstructingInvocation, MethodCall.TargetHandler.ForField, MethodCall.TargetHandler.ForMethodCall, MethodCall.TargetHandler.ForMethodParameter, MethodCall.TargetHandler.ForSelfOrStaticInvocation, MethodCall.TargetHandler.ForValue, MethodCall.TargetHandler.Resolved, MethodCall.TargetHandler.Simple -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StackManipulationThe stack manipulation that loads a target for the method call.private final TypeDescriptionThe type resolved by the stack manipulation. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSimple(TypeDescription typeDescription, StackManipulation stackManipulation) Creates a simple target handler. -
Method Summary
Modifier and TypeMethodDescriptionReturns the target's type description.make(Implementation.Target implementationTarget) Creates a target handler for a given implementation target.prepare(InstrumentedType instrumentedType) Prepares a given instrumented type.resolve(MethodDescription instrumentedMethod) Resolves this target handler.toStackManipulation(MethodDescription invokedMethod, Assigner assigner, Assigner.Typing typing) Creates a stack manipulation to represent this resolved target handler.
-
Field Details
-
typeDescription
The type resolved by the stack manipulation. -
stackManipulation
The stack manipulation that loads a target for the method call.
-
-
Constructor Details
-
Simple
Creates a simple target handler.- Parameters:
typeDescription- The type resolved by the stack manipulation.stackManipulation- The stack manipulation that loads a target for the method call.
-
-
Method Details
-
make
Creates a target handler for a given implementation target.- Specified by:
makein interfaceMethodCall.TargetHandler.Factory- Parameters:
implementationTarget- The implementation target to use.- Returns:
- The target handler to use.
-
prepare
Prepares a given instrumented type.- Specified by:
preparein interfaceInstrumentedType.Prepareable- Parameters:
instrumentedType- The instrumented type in its current form.- Returns:
- The prepared instrumented type.
-
resolve
Resolves this target handler.- Specified by:
resolvein interfaceMethodCall.TargetHandler- Parameters:
instrumentedMethod- The instrumented method.- Returns:
- The resolved target handler.
-
getTypeDescription
Returns the target's type description.- Specified by:
getTypeDescriptionin interfaceMethodCall.TargetHandler.Resolved- Returns:
- The target's type description.
-
toStackManipulation
public StackManipulation toStackManipulation(MethodDescription invokedMethod, Assigner assigner, Assigner.Typing typing) Creates a stack manipulation to represent this resolved target handler.- Specified by:
toStackManipulationin interfaceMethodCall.TargetHandler.Resolved- Parameters:
invokedMethod- The invoked method.assigner- The assigner to use.typing- The typing to apply.- Returns:
- A stack manipulation that implements this target handler.
-