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 java.lang.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
Fields Modifier and Type Field Description private TypeDescriptioninstrumentedTypeThe instrumented type.private ElementMatcher<? super MethodDescription>matcherThe matcher to use for locating the method to substitute with.private MethodGraph.CompilermethodGraphCompilerThe method graph compiler to use.
-
Constructor Summary
Constructors Constructor Description Matching(TypeDescription instrumentedType, MethodGraph.Compiler methodGraphCompiler, ElementMatcher<? super MethodDescription> matcher)Creates a new matching method resolver.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MethodDescriptionresolve(TypeDescription targetType, ByteCodeElement target, TypeList.Generic parameters, TypeDescription.Generic result)Resolves the method to substitute with.
-
-
-
Field Detail
-
instrumentedType
private final TypeDescription instrumentedType
The instrumented type.
-
methodGraphCompiler
private final MethodGraph.Compiler methodGraphCompiler
The method graph compiler to use.
-
matcher
private final ElementMatcher<? super MethodDescription> matcher
The matcher to use for locating the method to substitute with.
-
-
Constructor Detail
-
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 Detail
-
resolve
public MethodDescription resolve(TypeDescription targetType, ByteCodeElement target, TypeList.Generic parameters, TypeDescription.Generic result)
Resolves the method to substitute with.- Specified by:
resolvein 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 orvoidif no result is expected.- Returns:
- The field to substitute with.
-
-