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
@Enhance 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 Modifier and Type Class Description protected static interface
MethodCall.TargetHandler.ForField.Location
A location of a field.-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.MethodCall.TargetHandler
MethodCall.TargetHandler.ForConstructingInvocation, MethodCall.TargetHandler.ForField, MethodCall.TargetHandler.ForMethodCall, MethodCall.TargetHandler.ForMethodParameter, MethodCall.TargetHandler.ForSelfOrStaticInvocation, MethodCall.TargetHandler.ForValue
-
-
Field Summary
Fields Modifier and Type Field Description private MethodCall.TargetHandler.ForField.Location
location
The field's location.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForField(MethodCall.TargetHandler.ForField.Location location)
Creates a new target handler for a field.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InstrumentedType
prepare(InstrumentedType instrumentedType)
Prepares a given instrumented type.TypeDescription
resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod)
Resolves the method call's target.StackManipulation
resolve(Implementation.Target implementationTarget, MethodDescription invokedMethod, MethodDescription instrumentedMethod, TypeDescription instrumentedType, Assigner assigner, Assigner.Typing typing)
Creates a stack manipulation that represents the method's invocation.
-
-
-
Field Detail
-
location
private final MethodCall.TargetHandler.ForField.Location location
The field's location.
-
-
Constructor Detail
-
ForField
protected ForField(MethodCall.TargetHandler.ForField.Location location)
Creates a new target handler for a field.- Parameters:
location
- The field's location.
-
-
Method Detail
-
resolve
public StackManipulation resolve(Implementation.Target implementationTarget, MethodDescription invokedMethod, MethodDescription instrumentedMethod, TypeDescription instrumentedType, Assigner assigner, Assigner.Typing typing)
Creates a stack manipulation that represents the method's invocation.- Specified by:
resolve
in interfaceMethodCall.TargetHandler
- Parameters:
implementationTarget
- The implementation target.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.
-
resolve
public TypeDescription resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod)
Resolves the method call's target.- Specified by:
resolve
in interfaceMethodCall.TargetHandler
- Parameters:
instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.- Returns:
- method call's target
-
prepare
public InstrumentedType prepare(InstrumentedType instrumentedType)
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.
-
-