Class MemberSubstitution.Substitution.ForMethodInvocation
java.lang.Object
net.bytebuddy.asm.MemberSubstitution.Substitution.ForMethodInvocation
- All Implemented Interfaces:
MemberSubstitution.Substitution<MemberSubstitution.Target>
- Enclosing interface:
MemberSubstitution.Substitution<T extends MemberSubstitution.Target>
@Enhance
public static class MemberSubstitution.Substitution.ForMethodInvocation
extends Object
implements MemberSubstitution.Substitution<MemberSubstitution.Target>
A substitution with a method invocation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA method resolver for locating a method for a substitute.static classA factory for a substitution that invokes a given method.(package private) static enumA factory for a substitution that invokes the instrumented method.static classA factory for a substitution that locates a method on the receiver type using a matcher.Nested classes/interfaces inherited from interface MemberSubstitution.Substitution
MemberSubstitution.Substitution.Chain<S>, MemberSubstitution.Substitution.Factory<S>, MemberSubstitution.Substitution.ForFieldAccess, MemberSubstitution.Substitution.ForMethodInvocation, MemberSubstitution.Substitution.ForValue, MemberSubstitution.Substitution.Stubbing -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TypeDescriptionThe instrumented type.The method resolver to use. -
Constructor Summary
ConstructorsConstructorDescriptionForMethodInvocation(TypeDescription instrumentedType, MemberSubstitution.Substitution.ForMethodInvocation.MethodResolver methodResolver) Creates a new method-resolving substitution. -
Method Summary
Modifier and TypeMethodDescriptionresolve(MemberSubstitution.Target target, TypeList.Generic parameters, TypeDescription.Generic result, JavaConstant.MethodHandle methodHandle, StackManipulation stackManipulation, int freeOffset) Resolves this substitution into a stack manipulation.
-
Field Details
-
instrumentedType
The instrumented type. -
methodResolver
The method resolver to use.
-
-
Constructor Details
-
ForMethodInvocation
public ForMethodInvocation(TypeDescription instrumentedType, MemberSubstitution.Substitution.ForMethodInvocation.MethodResolver methodResolver) Creates a new method-resolving substitution.- Parameters:
instrumentedType- The instrumented type.methodResolver- The method resolver to use.
-
-
Method Details
-
resolve
public StackManipulation resolve(MemberSubstitution.Target target, TypeList.Generic parameters, TypeDescription.Generic result, JavaConstant.MethodHandle methodHandle, StackManipulation stackManipulation, int freeOffset) Resolves this substitution into a stack manipulation.- Specified by:
resolvein interfaceMemberSubstitution.Substitution<MemberSubstitution.Target>- Parameters:
target- The targeted member that is substituted.parameters- All parameters that serve as input to this access.result- The result that is expected from the interaction orvoidif no result is expected.methodHandle- A method handle describing the substituted expression.stackManipulation- The original byte code expression that is being executed.freeOffset- The first free offset of the local variable array that can be used for storing values.- Returns:
- A stack manipulation that represents the access.
-