Package net.bytebuddy.asm
Class MemberSubstitution.Substitution.ForMethodInvocation.OfMatchedMethod
java.lang.Object
net.bytebuddy.asm.MemberSubstitution.Substitution.ForMethodInvocation.OfMatchedMethod
- All Implemented Interfaces:
MemberSubstitution.Substitution.Factory
- Enclosing class:
MemberSubstitution.Substitution.ForMethodInvocation
@Enhance
public static class MemberSubstitution.Substitution.ForMethodInvocation.OfMatchedMethod
extends Object
implements MemberSubstitution.Substitution.Factory
A factory for a substitution that locates a method on the receiver type using a matcher.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ElementMatcher
<? super MethodDescription> The matcher for locating the method to substitute with.private final MethodGraph.Compiler
The method graph compiler to use. -
Constructor Summary
ConstructorsConstructorDescriptionOfMatchedMethod
(ElementMatcher<? super MethodDescription> matcher, MethodGraph.Compiler methodGraphCompiler) Creates a factory for a substitution that locates a method on the receiver type. -
Method Summary
Modifier and TypeMethodDescriptionmake
(TypeDescription instrumentedType, MethodDescription instrumentedMethod, TypePool typePool) Creates a substitution for an instrumented method.
-
Field Details
-
matcher
The matcher for locating the method to substitute with. -
methodGraphCompiler
The method graph compiler to use.
-
-
Constructor Details
-
OfMatchedMethod
public OfMatchedMethod(ElementMatcher<? super MethodDescription> matcher, MethodGraph.Compiler methodGraphCompiler) Creates a factory for a substitution that locates a method on the receiver type.- Parameters:
matcher
- The matcher for locating the method to substitute with.methodGraphCompiler
- The method graph compiler to use.
-
-
Method Details
-
make
public MemberSubstitution.Substitution make(TypeDescription instrumentedType, MethodDescription instrumentedMethod, TypePool typePool) Creates a substitution for an instrumented method.- Specified by:
make
in interfaceMemberSubstitution.Substitution.Factory
- Parameters:
instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.typePool
- The type pool being used.- Returns:
- The substitution to apply within the instrumented method.
-