Package net.bytebuddy.implementation
Class MethodCall.MethodInvoker.ForContextualInvocation
java.lang.Object
net.bytebuddy.implementation.MethodCall.MethodInvoker.ForContextualInvocation
- All Implemented Interfaces:
MethodCall.MethodInvoker
- Enclosing interface:
- MethodCall.MethodInvoker
@Enhance
public static class MethodCall.MethodInvoker.ForContextualInvocation
extends Object
implements MethodCall.MethodInvoker
Applies a contextual invocation of the provided method, i.e. a static invocation for static methods,
a special invocation for constructors and private methods and a virtual invocation for any other method.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enum
A factory for creating a contextual method invoker.Nested classes/interfaces inherited from interface net.bytebuddy.implementation.MethodCall.MethodInvoker
MethodCall.MethodInvoker.ForContextualInvocation, MethodCall.MethodInvoker.ForDefaultMethodInvocation, MethodCall.MethodInvoker.ForSuperMethodInvocation, MethodCall.MethodInvoker.ForVirtualInvocation
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ForContextualInvocation
(TypeDescription instrumentedType) Creates a new method invoker for a contextual invocation. -
Method Summary
Modifier and TypeMethodDescriptiontoStackManipulation
(MethodDescription invokedMethod, Implementation.Target implementationTarget) Invokes the method.
-
Field Details
-
instrumentedType
The instrumented type.
-
-
Constructor Details
-
ForContextualInvocation
Creates a new method invoker for a contextual invocation.- Parameters:
instrumentedType
- The instrumented type.
-
-
Method Details
-
toStackManipulation
public StackManipulation toStackManipulation(MethodDescription invokedMethod, Implementation.Target implementationTarget) Invokes the method.- Specified by:
toStackManipulation
in interfaceMethodCall.MethodInvoker
- Parameters:
invokedMethod
- The method to be invoked.implementationTarget
- The implementation target of the instrumented instance.- Returns:
- A stack manipulation that represents the method invocation.
-