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 classMethodCall.MethodLocator.ForElementMatcher.FactoryA 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 TypeDescriptioninstrumentedTypeThe instrumented type.private ElementMatcher<? super MethodDescription>matcherThe matcher to use.private MethodGraph.CompilermethodGraphCompilerThe method graph compiler to use.
-
Constructor Summary
Constructors Modifier Constructor Description protectedForElementMatcher(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 MethodDescriptionresolve(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:
resolvein interfaceMethodCall.MethodLocator- Parameters:
targetType- The type the method is called on.instrumentedMethod- The method being instrumented.- Returns:
- The method to invoke.
-
-