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:
CachedReturnPlugin
- Enclosing interface:
- Plugin
@Enhance public abstract static class Plugin.ForElementMatcher extends java.lang.Object implements Plugin
An abstract base for aPlugin
that 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.WithPreprocessor
-
-
Field Summary
Fields Modifier and Type Field Description private ElementMatcher<? super TypeDescription>
matcher
The element matcher to apply.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForElementMatcher(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 boolean
matches(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(TypeDescription target)
Matches a target against this element matcher.- Specified by:
matches
in interfaceElementMatcher<TypeDescription>
- Parameters:
target
- The instance to be matched.- Returns:
true
if the given element is matched by this matcher orfalse
otherwise.
-
-