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.NoOp
Nested 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 StackManipulation
The stack manipulation that loads a target for the method call.private final TypeDescription
The type resolved by the stack manipulation. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Simple
(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:
make
in interfaceMethodCall.TargetHandler.Factory
- Parameters:
implementationTarget
- The implementation target to use.- Returns:
- The target handler to use.
-
prepare
Prepares a given instrumented type.- Specified by:
prepare
in interfaceInstrumentedType.Prepareable
- Parameters:
instrumentedType
- The instrumented type in its current form.- Returns:
- The prepared instrumented type.
-
resolve
Resolves this target handler.- Specified by:
resolve
in interfaceMethodCall.TargetHandler
- Parameters:
instrumentedMethod
- The instrumented method.- Returns:
- The resolved target handler.
-
getTypeDescription
Returns the target's type description.- Specified by:
getTypeDescription
in 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:
toStackManipulation
in 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.
-