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 Object
implements MethodCall.MethodLocator
A method locator that identifies a unique virtual method.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
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
FieldsModifier and TypeFieldDescriptionprivate final TypeDescription
The instrumented type.private final ElementMatcher<? super MethodDescription>
The matcher to use.private final MethodGraph.Compiler
The method graph compiler to use. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ForElementMatcher
(TypeDescription instrumentedType, ElementMatcher<? super MethodDescription> matcher, MethodGraph.Compiler methodGraphCompiler) Creates a new method locator for an element matcher. -
Method Summary
Modifier and TypeMethodDescriptionresolve
(TypeDescription targetType, MethodDescription instrumentedMethod) Resolves the method to be invoked.
-
Field Details
-
instrumentedType
The instrumented type. -
matcher
The matcher to use. -
methodGraphCompiler
The method graph compiler to use.
-
-
Constructor Details
-
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 Details
-
resolve
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.
-