Package net.bytebuddy.implementation
Class MethodCall.MethodLocator.ForElementMatcher
- java.lang.Object
-
- net.bytebuddy.implementation.MethodCall.MethodLocator.ForElementMatcher
-
- All Implemented Interfaces:
MethodCall.MethodLocator
- Enclosing interface:
- MethodCall.MethodLocator
@Enhance public static class MethodCall.MethodLocator.ForElementMatcher extends java.lang.Object implements MethodCall.MethodLocator
A method locator that identifies a unique virtual method.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MethodCall.MethodLocator.ForElementMatcher.Factory
A factory for a method locator that uses a matcher on the instrumented type's available methods for identifing a target method.-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.MethodCall.MethodLocator
MethodCall.MethodLocator.ForElementMatcher, MethodCall.MethodLocator.ForExplicitMethod, MethodCall.MethodLocator.ForInstrumentedMethod
-
-
Field Summary
Fields Modifier and Type Field Description private TypeDescription
instrumentedType
The instrumented type.private ElementMatcher<? super MethodDescription>
matcher
The matcher to use.private MethodGraph.Compiler
methodGraphCompiler
The method graph compiler to use.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForElementMatcher(TypeDescription instrumentedType, ElementMatcher<? super MethodDescription> matcher, MethodGraph.Compiler methodGraphCompiler)
Creates a new method locator for an element matcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MethodDescription
resolve(TypeDescription targetType, MethodDescription instrumentedMethod)
Resolves the method to be invoked.
-
-
-
Field Detail
-
instrumentedType
private final TypeDescription instrumentedType
The instrumented type.
-
matcher
private final ElementMatcher<? super MethodDescription> matcher
The matcher to use.
-
methodGraphCompiler
private final MethodGraph.Compiler methodGraphCompiler
The method graph compiler to use.
-
-
Constructor Detail
-
ForElementMatcher
protected ForElementMatcher(TypeDescription instrumentedType, ElementMatcher<? super MethodDescription> matcher, MethodGraph.Compiler methodGraphCompiler)
Creates a new method locator for an element matcher.- Parameters:
instrumentedType
- The instrumented type.matcher
- The matcher to use.methodGraphCompiler
- The method graph compiler to use.
-
-
Method Detail
-
resolve
public MethodDescription resolve(TypeDescription targetType, MethodDescription instrumentedMethod)
Resolves the method to be invoked.- Specified by:
resolve
in interfaceMethodCall.MethodLocator
- Parameters:
targetType
- The type the method is called on.instrumentedMethod
- The method being instrumented.- Returns:
- The method to invoke.
-
-