Package net.bytebuddy.asm
Class MemberSubstitution.Substitution.ForMethodInvocation
- java.lang.Object
-
- net.bytebuddy.asm.MemberSubstitution.Substitution.ForMethodInvocation
-
- All Implemented Interfaces:
MemberSubstitution.Substitution
- Enclosing interface:
- MemberSubstitution.Substitution
@Enhance public static class MemberSubstitution.Substitution.ForMethodInvocation extends java.lang.Object implements MemberSubstitution.Substitution
A substitution with a method invocation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
MemberSubstitution.Substitution.ForMethodInvocation.MethodResolver
A method resolver for locating a method for a substitute.static class
MemberSubstitution.Substitution.ForMethodInvocation.OfGivenMethod
A factory for a substitution that invokes a given method.(package private) static class
MemberSubstitution.Substitution.ForMethodInvocation.OfInstrumentedMethod
A factory for a substitution that invokes the instrumented method.static class
MemberSubstitution.Substitution.ForMethodInvocation.OfMatchedMethod
A 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, MemberSubstitution.Substitution.Factory, MemberSubstitution.Substitution.ForFieldAccess, MemberSubstitution.Substitution.ForMethodInvocation, MemberSubstitution.Substitution.Stubbing
-
-
Field Summary
Fields Modifier and Type Field Description private TypeDescription
instrumentedType
The instrumented type.private MemberSubstitution.Substitution.ForMethodInvocation.MethodResolver
methodResolver
The method resolver to use.private static int
THIS_REFERENCE
The index of the this reference within a non-static method.
-
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 StackManipulation
resolve(TypeDescription targetType, ByteCodeElement target, TypeList.Generic parameters, TypeDescription.Generic result, int freeOffset)
Resolves this substitution into a stack manipulation.
-
-
-
Field Detail
-
THIS_REFERENCE
private static final int THIS_REFERENCE
The index of the this reference within a non-static method.- See Also:
- Constant Field Values
-
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(TypeDescription targetType, ByteCodeElement target, TypeList.Generic parameters, TypeDescription.Generic result, int freeOffset)
Resolves this substitution into a stack manipulation.- Specified by:
resolve
in interfaceMemberSubstitution.Substitution
- Parameters:
targetType
- The target type on which a member is accessed.target
- The target field, method or constructor that is substituted,parameters
- All parameters that serve as input to this access.result
- The result that is expected from the interaction orvoid
if no result is expected.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.
-
-