Package net.bytebuddy.asm
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 java.lang.Object implements MemberSubstitution.Substitution<MemberSubstitution.Target>
A substitution with a method invocation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceMemberSubstitution.Substitution.ForMethodInvocation.MethodResolverA method resolver for locating a method for a substitute.static classMemberSubstitution.Substitution.ForMethodInvocation.OfGivenMethodA factory for a substitution that invokes a given method.(package private) static classMemberSubstitution.Substitution.ForMethodInvocation.OfInstrumentedMethodA factory for a substitution that invokes the instrumented method.static classMemberSubstitution.Substitution.ForMethodInvocation.OfMatchedMethodA factory for a substitution that locates a method on the receiver type using a matcher.-
Nested classes/interfaces inherited from interface net.bytebuddy.asm.MemberSubstitution.Substitution
MemberSubstitution.Substitution.Chain<S extends MemberSubstitution.Target>, MemberSubstitution.Substitution.Factory<S extends MemberSubstitution.Target>, MemberSubstitution.Substitution.ForFieldAccess, MemberSubstitution.Substitution.ForMethodInvocation, MemberSubstitution.Substitution.ForValue, MemberSubstitution.Substitution.Stubbing
-
-
Field Summary
Fields Modifier and Type Field Description private TypeDescriptioninstrumentedTypeThe instrumented type.private MemberSubstitution.Substitution.ForMethodInvocation.MethodResolvermethodResolverThe method resolver to use.
-
Constructor Summary
Constructors Constructor Description ForMethodInvocation(TypeDescription instrumentedType, MemberSubstitution.Substitution.ForMethodInvocation.MethodResolver methodResolver)Creates a new method-resolving substitution.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StackManipulationresolve(MemberSubstitution.Target target, TypeList.Generic parameters, TypeDescription.Generic result, JavaConstant.MethodHandle methodHandle, StackManipulation stackManipulation, int freeOffset)Resolves this substitution into a stack manipulation.
-
-
-
Field Detail
-
instrumentedType
private final TypeDescription instrumentedType
The instrumented type.
-
methodResolver
private final MemberSubstitution.Substitution.ForMethodInvocation.MethodResolver methodResolver
The method resolver to use.
-
-
Constructor Detail
-
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 Detail
-
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.
-
-