Package net.bytebuddy.build
Class Plugin.ForElementMatcher
- java.lang.Object
-
- net.bytebuddy.build.Plugin.ForElementMatcher
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Plugin,ElementMatcher<TypeDescription>
- Direct Known Subclasses:
AccessControllerPlugin,CachedReturnPlugin,DispatcherAnnotationPlugin,RepeatedAnnotationPlugin,SafeVarargsPlugin
- Enclosing interface:
- Plugin
@Enhance public abstract static class Plugin.ForElementMatcher extends java.lang.Object implements Plugin
An abstract base for aPluginthat matches types by a givenElementMatcher.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.matcher.ElementMatcher
ElementMatcher.Junction<S>
-
Nested classes/interfaces inherited from interface net.bytebuddy.build.Plugin
Plugin.Engine, Plugin.Factory, Plugin.ForElementMatcher, Plugin.NoOp, Plugin.WithInitialization, Plugin.WithPreprocessor
-
-
Field Summary
Fields Modifier and Type Field Description private ElementMatcher<? super TypeDescription>matcherThe element matcher to apply.
-
Constructor Summary
Constructors Modifier Constructor Description protectedForElementMatcher(ElementMatcher<? super TypeDescription> matcher)Creates a new plugin that matches types using an element matcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanmatches(TypeDescription target)Matches a target against this element matcher.
-
-
-
Field Detail
-
matcher
private final ElementMatcher<? super TypeDescription> matcher
The element matcher to apply.
-
-
Constructor Detail
-
ForElementMatcher
protected ForElementMatcher(ElementMatcher<? super TypeDescription> matcher)
Creates a new plugin that matches types using an element matcher.- Parameters:
matcher- The element matcher to apply.
-
-
Method Detail
-
matches
public boolean matches(@MaybeNull TypeDescription target)
Matches a target against this element matcher.- Specified by:
matchesin interfaceElementMatcher<TypeDescription>- Parameters:
target- The instance to be matched ornull.- Returns:
trueif the given element is matched by this matcher orfalseotherwise.
-
-