Class InliningImplementationMatcher
- java.lang.Object
-
- net.bytebuddy.dynamic.scaffold.inline.InliningImplementationMatcher
-
- All Implemented Interfaces:
LatentMatcher<MethodDescription>
@Enhance public class InliningImplementationMatcher extends java.lang.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
Fields Modifier and Type Field Description private LatentMatcher<? super MethodDescription>
ignoredMethods
A method matcher that matches any ignored method.private ElementMatcher<? super MethodDescription>
predefinedMethodSignatures
A method matcher that matches any predefined method.
-
Constructor Summary
Constructors Modifier Constructor Description protected
InliningImplementationMatcher(LatentMatcher<? super MethodDescription> ignoredMethods, ElementMatcher<? super MethodDescription> predefinedMethodSignatures)
Creates a new inline implementation matcher.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.ElementMatcher<? super MethodDescription>
resolve(TypeDescription typeDescription)
Resolves the element matcher this instance represents for the supplied type description.
-
-
-
Field Detail
-
ignoredMethods
private final LatentMatcher<? super MethodDescription> ignoredMethods
A method matcher that matches any ignored method.
-
predefinedMethodSignatures
private final ElementMatcher<? super MethodDescription> predefinedMethodSignatures
A method matcher that matches any predefined method.
-
-
Constructor Detail
-
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 Detail
-
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
public ElementMatcher<? super MethodDescription> resolve(TypeDescription typeDescription)
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.
-
-