Package net.bytebuddy.implementation
Class MethodCall.TargetHandler.ForMethodCall
- java.lang.Object
-
- net.bytebuddy.implementation.MethodCall.TargetHandler.ForMethodCall
-
- All Implemented Interfaces:
InstrumentedType.Prepareable
,MethodCall.TargetHandler
- Enclosing interface:
- MethodCall.TargetHandler
@Enhance public static class MethodCall.TargetHandler.ForMethodCall extends java.lang.Object implements MethodCall.TargetHandler
A target handler that executes the method and uses it's return value 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 MethodCall
methodCall
The method that is executed and whose return value is used as the target object.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForMethodCall(MethodCall methodCall)
Creates a new target handler for the instrumented method.
-
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
-
methodCall
private final MethodCall methodCall
The method that is executed and whose return value is used as the target object.
-
-
Constructor Detail
-
ForMethodCall
protected ForMethodCall(MethodCall methodCall)
Creates a new target handler for the instrumented method.- Parameters:
methodCall
- The method call that is the target of the method 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.
-
-