Class InliningImplementationMatcher
java.lang.Object
net.bytebuddy.dynamic.scaffold.inline.InliningImplementationMatcher
- All Implemented Interfaces:
LatentMatcher<MethodDescription>
@Enhance
public class InliningImplementationMatcher
extends Object
implements LatentMatcher<MethodDescription>
A latent method matcher that identifies methods to instrument when redefining or rebasing a type.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.matcher.LatentMatcher
LatentMatcher.Conjunction<S>, LatentMatcher.Disjunction<S>, LatentMatcher.ForFieldToken, LatentMatcher.ForMethodToken, LatentMatcher.ForRecordComponentToken, LatentMatcher.ForSelfDeclaredMethod, LatentMatcher.Resolved<S>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LatentMatcher
<? super MethodDescription> A method matcher that matches any ignored method.private final ElementMatcher
<? super MethodDescription> A method matcher that matches any predefined method. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
InliningImplementationMatcher
(LatentMatcher<? super MethodDescription> ignoredMethods, ElementMatcher<? super MethodDescription> predefinedMethodSignatures) Creates a new inline implementation matcher. -
Method Summary
Modifier and TypeMethodDescriptionprotected static LatentMatcher
<MethodDescription> of
(LatentMatcher<? super MethodDescription> ignoredMethods, TypeDescription originalType) Creates a matcher where only overridable or declared methods are matched unless those are ignored.ElementMatcher
<? super MethodDescription> resolve
(TypeDescription typeDescription) Resolves the element matcher this instance represents for the supplied type description.
-
Field Details
-
ignoredMethods
A method matcher that matches any ignored method. -
predefinedMethodSignatures
A method matcher that matches any predefined method.
-
-
Constructor Details
-
InliningImplementationMatcher
protected InliningImplementationMatcher(LatentMatcher<? super MethodDescription> ignoredMethods, ElementMatcher<? super MethodDescription> predefinedMethodSignatures) Creates a new inline implementation matcher.- Parameters:
ignoredMethods
- A method matcher that matches any ignored method.predefinedMethodSignatures
- A method matcher that matches any predefined method.
-
-
Method Details
-
of
protected static LatentMatcher<MethodDescription> of(LatentMatcher<? super MethodDescription> ignoredMethods, TypeDescription originalType) Creates a matcher where only overridable or declared methods are matched unless those are ignored. Methods that are declared by the target type are only matched if they are not ignored. Declared methods that are not found on the target type are always matched.- Parameters:
ignoredMethods
- A method matcher that matches any ignored method.originalType
- The original type of the instrumentation before adding any user methods.- Returns:
- A latent method matcher that identifies any method to instrument for a rebasement or redefinition.
-
resolve
Resolves the element matcher this instance represents for the supplied type description.- Specified by:
resolve
in interfaceLatentMatcher<MethodDescription>
- Parameters:
typeDescription
- The type description for which the represented matcher should be resolved.- Returns:
- An
ElementMatcher
that represents this matcher's resolved form.
-