Package net.bytebuddy.implementation
Class MethodCall.TargetHandler.ForMethodParameter
- java.lang.Object
-
- net.bytebuddy.implementation.MethodCall.TargetHandler.ForMethodParameter
-
- All Implemented Interfaces:
InstrumentedType.Prepareable
,MethodCall.TargetHandler
- Enclosing interface:
- MethodCall.TargetHandler
@Enhance public static class MethodCall.TargetHandler.ForMethodParameter extends java.lang.Object implements MethodCall.TargetHandler
A target handler that loads the parameter of the given index as the target object.
-
-
Nested Class Summary
-
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 int
index
The index of the instrumented method's parameter that is the target of the method invocation.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForMethodParameter(int index)
Creates a new target handler for the instrumented method's argument.
-
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.
-
-
-
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.
-
-