Package net.bytebuddy.asm
Class MemberSubstitution.Substitution.ForMethodInvocation.MethodResolver.Matching
java.lang.Object
net.bytebuddy.asm.MemberSubstitution.Substitution.ForMethodInvocation.MethodResolver.Matching
- All Implemented Interfaces:
MemberSubstitution.Substitution.ForMethodInvocation.MethodResolver
- Enclosing interface:
- MemberSubstitution.Substitution.ForMethodInvocation.MethodResolver
@Enhance
public static class MemberSubstitution.Substitution.ForMethodInvocation.MethodResolver.Matching
extends Object
implements MemberSubstitution.Substitution.ForMethodInvocation.MethodResolver
A method resolver that locates a non-static method by locating it from the receiver type.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.asm.MemberSubstitution.Substitution.ForMethodInvocation.MethodResolver
MemberSubstitution.Substitution.ForMethodInvocation.MethodResolver.Matching, MemberSubstitution.Substitution.ForMethodInvocation.MethodResolver.Simple
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TypeDescription
The instrumented type.private final ElementMatcher<? super MethodDescription>
The matcher to use for locating the method to substitute with.private final MethodGraph.Compiler
The method graph compiler to use. -
Constructor Summary
ConstructorsConstructorDescriptionMatching
(TypeDescription instrumentedType, MethodGraph.Compiler methodGraphCompiler, ElementMatcher<? super MethodDescription> matcher) Creates a new matching method resolver. -
Method Summary
Modifier and TypeMethodDescriptionresolve
(TypeDescription targetType, ByteCodeElement target, TypeList.Generic parameters, TypeDescription.Generic result) Resolves the method to substitute with.
-
Field Details
-
instrumentedType
The instrumented type. -
methodGraphCompiler
The method graph compiler to use. -
matcher
The matcher to use for locating the method to substitute with.
-
-
Constructor Details
-
Matching
public Matching(TypeDescription instrumentedType, MethodGraph.Compiler methodGraphCompiler, ElementMatcher<? super MethodDescription> matcher) Creates a new matching method resolver.- Parameters:
instrumentedType
- The instrumented type.methodGraphCompiler
- The method graph compiler to use.matcher
- The matcher to use for locating the method to substitute with.
-
-
Method Details
-
resolve
public MethodDescription resolve(TypeDescription targetType, ByteCodeElement target, TypeList.Generic parameters, TypeDescription.Generic result) Resolves the method to substitute with.- Specified by:
resolve
in interfaceMemberSubstitution.Substitution.ForMethodInvocation.MethodResolver
- 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.- Returns:
- The field to substitute with.
-