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.ForValue, 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.
-
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 receiver, ByteCodeElement.Member original, 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(TypeDescription receiver, ByteCodeElement.Member original, TypeList.Generic parameters, TypeDescription.Generic result, JavaConstant.MethodHandle methodHandle, StackManipulation stackManipulation, int freeOffset)
Resolves this substitution into a stack manipulation.- Specified by:
resolve
in interfaceMemberSubstitution.Substitution
- Parameters:
receiver
- The target type on which a member is accessed.original
- The 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.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.
-
-