Package net.bytebuddy.implementation
Class MethodCall.TargetHandler.ForField
- java.lang.Object
-
- net.bytebuddy.implementation.MethodCall.TargetHandler.ForField
-
- All Implemented Interfaces:
InstrumentedType.Prepareable
,MethodCall.TargetHandler
- Enclosing interface:
- MethodCall.TargetHandler
public static class MethodCall.TargetHandler.ForField extends java.lang.Object implements MethodCall.TargetHandler
Creates a target handler that stores the instance to invoke a method on in an instance field.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.MethodCall.TargetHandler
MethodCall.TargetHandler.ForConstructingInvocation, MethodCall.TargetHandler.ForField, MethodCall.TargetHandler.ForMethodParameter, MethodCall.TargetHandler.ForSelfOrStaticInvocation, MethodCall.TargetHandler.ForValue
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForField(java.lang.String name, FieldLocator.Factory fieldLocatorFactory)
Creates a new target handler for storing a method invocation target in an instance field.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InstrumentedType
prepare(InstrumentedType instrumentedType)
Prepares a given instrumented type.StackManipulation
resolve(MethodDescription invokedMethod, MethodDescription instrumentedMethod, TypeDescription instrumentedType, Assigner assigner, Assigner.Typing typing)
Creates a stack manipulation that represents the method's invocation.
-
-
-
Constructor Detail
-
ForField
protected ForField(java.lang.String name, FieldLocator.Factory fieldLocatorFactory)
Creates a new target handler for storing a method invocation target in an instance field.- Parameters:
name
- The name of the field.fieldLocatorFactory
- The field locator factory to use.
-
-
Method Detail
-
resolve
public StackManipulation resolve(MethodDescription invokedMethod, MethodDescription instrumentedMethod, TypeDescription instrumentedType, Assigner assigner, Assigner.Typing typing)
Description copied from interface:MethodCall.TargetHandler
Creates a stack manipulation that represents the method's invocation.- Specified by:
resolve
in interfaceMethodCall.TargetHandler
- Parameters:
invokedMethod
- The method to be invoked.instrumentedMethod
- The instrumented method.instrumentedType
- The instrumented type. @return A stack manipulation that invokes the method.assigner
- The assigner to use.typing
- The typing to apply.- Returns:
- A stack manipulation that loads the method target onto the operand stack.
-
prepare
public InstrumentedType prepare(InstrumentedType instrumentedType)
Description copied from interface:InstrumentedType.Prepareable
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.
-
-