Package net.bytebuddy.implementation
Class MethodCall.TargetHandler.ForMethodParameter
java.lang.Object
net.bytebuddy.implementation.MethodCall.TargetHandler.ForMethodParameter
- All Implemented Interfaces:
InstrumentedType.Prepareable
,MethodCall.TargetHandler
,MethodCall.TargetHandler.Factory
- Enclosing interface:
- MethodCall.TargetHandler
@Enhance
public static class MethodCall.TargetHandler.ForMethodParameter
extends Object
implements MethodCall.TargetHandler, MethodCall.TargetHandler.Factory
A target handler that loads the parameter of the given index as the target object.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
A resolved target handler for a method parameter.Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable
InstrumentedType.Prepareable.NoOp
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.MethodCall.TargetHandler
MethodCall.TargetHandler.Factory, MethodCall.TargetHandler.ForConstructingInvocation, MethodCall.TargetHandler.ForField, MethodCall.TargetHandler.ForMethodCall, MethodCall.TargetHandler.ForMethodParameter, MethodCall.TargetHandler.ForSelfOrStaticInvocation, MethodCall.TargetHandler.ForValue, MethodCall.TargetHandler.Simple
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
The index of the instrumented method's parameter that is the target of the method invocation. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ForMethodParameter
(int index) Creates a new target handler for the instrumented method's argument. -
Method Summary
Modifier and TypeMethodDescriptionmake
(Implementation.Target implementationTarget) Creates a target handler for a given implementation target.prepare
(InstrumentedType instrumentedType) Prepares a given instrumented type.resolve
(MethodDescription instrumentedMethod) Resolves this target handler.
-
Field Details
-
index
private final int indexThe index of the instrumented method's parameter that is the target of the method invocation.
-
-
Constructor Details
-
ForMethodParameter
protected ForMethodParameter(int index) Creates a new target handler for the instrumented method's argument.- Parameters:
index
- The index of the instrumented method's parameter that is the target of the method invocation.
-
-
Method Details
-
prepare
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.
-
make
Creates a target handler for a given implementation target.- Specified by:
make
in interfaceMethodCall.TargetHandler.Factory
- Parameters:
implementationTarget
- The implementation target to use.- Returns:
- The target handler to use.
-
resolve
Resolves this target handler.- Specified by:
resolve
in interfaceMethodCall.TargetHandler
- Parameters:
instrumentedMethod
- The instrumented method.- Returns:
- The resolved target handler.
-