Class MethodCall.MethodInvoker.ForVirtualInvocation
java.lang.Object
net.bytebuddy.implementation.MethodCall.MethodInvoker.ForVirtualInvocation
- All Implemented Interfaces:
MethodCall.MethodInvoker
- Enclosing interface:
MethodCall.MethodInvoker
@Enhance
public static class MethodCall.MethodInvoker.ForVirtualInvocation
extends Object
implements MethodCall.MethodInvoker
Applies a virtual invocation on a given type.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classA method invoker factory for a virtual method invocation.protected static enumA method invoker for a virtual method that uses an implicit target type.Nested classes/interfaces inherited from interface MethodCall.MethodInvoker
MethodCall.MethodInvoker.ForContextualInvocation, MethodCall.MethodInvoker.ForDefaultMethodInvocation, MethodCall.MethodInvoker.ForSuperMethodInvocation, MethodCall.MethodInvoker.ForVirtualInvocation -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TypeDescriptionThe type description to virtually invoke the method upon. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedForVirtualInvocation(TypeDescription typeDescription) Creates a new method invoking for a virtual method invocation. -
Method Summary
Modifier and TypeMethodDescriptiontoStackManipulation(MethodDescription invokedMethod, Implementation.Target implementationTarget) Invokes the method.
-
Field Details
-
typeDescription
The type description to virtually invoke the method upon.
-
-
Constructor Details
-
ForVirtualInvocation
Creates a new method invoking for a virtual method invocation.- Parameters:
typeDescription- The type description to virtually invoke the method upon.
-
-
Method Details
-
toStackManipulation
public StackManipulation toStackManipulation(MethodDescription invokedMethod, Implementation.Target implementationTarget) Invokes the method.- Specified by:
toStackManipulationin 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.
-