Package net.bytebuddy.implementation
Class MethodCall.TargetHandler.ForValue
java.lang.Object
net.bytebuddy.implementation.MethodCall.TargetHandler.ForValue
- All Implemented Interfaces:
MethodCall.TargetHandler
,MethodCall.TargetHandler.Resolved
- Enclosing interface:
MethodCall.TargetHandler
@Enhance
public static class MethodCall.TargetHandler.ForValue
extends Object
implements MethodCall.TargetHandler, MethodCall.TargetHandler.Resolved
A target handler that invokes a method on an instance that is stored in a static field.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
A factory for a target handler that loads a specific value.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.InDefinedShape
A description of the field that contains the value. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ForValue
(FieldDescription.InDefinedShape fieldDescription) Creates a new target handler for a field value. -
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 contains the value.
-
-
Constructor Details
-
ForValue
Creates a new target handler for a field value.- Parameters:
fieldDescription
- A description of the field that contains the value.
-
-
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.
-