Package net.bytebuddy.implementation
Class MethodCall.TargetHandler.ForField
java.lang.Object
net.bytebuddy.implementation.MethodCall.TargetHandler.ForField
- All Implemented Interfaces:
MethodCall.TargetHandler
,MethodCall.TargetHandler.Resolved
- Enclosing interface:
MethodCall.TargetHandler
@Enhance
public static class MethodCall.TargetHandler.ForField
extends Object
implements MethodCall.TargetHandler, MethodCall.TargetHandler.Resolved
Creates a target handler that stores the instance to invoke a method on in an instance field.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
A factory for a field access.protected static interface
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, MethodCall.TargetHandler.Resolved, MethodCall.TargetHandler.Simple
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FieldDescription
A description of the field that is the target. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ForField
(FieldDescription fieldDescription) Creates a new target handler for a field description. -
Method Summary
Modifier and TypeMethodDescriptionReturns the target's type description.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
-
fieldDescription
A description of the field that is the target.
-
-
Constructor Details
-
ForField
Creates a new target handler for a field description.- Parameters:
fieldDescription
- A description of the field that is the target.
-
-
Method Details
-
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.
-