Package net.bytebuddy.build
Class Plugin.Engine.Source.Origin.Filtering
java.lang.Object
net.bytebuddy.build.Plugin.Engine.Source.Origin.Filtering
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterable<Plugin.Engine.Source.Element>
,Plugin.Engine.Source.Origin
- Enclosing interface:
- Plugin.Engine.Source.Origin
@Enhance
public static class Plugin.Engine.Source.Origin.Filtering
extends Object
implements Plugin.Engine.Source.Origin
An origin that forwards all invocations to a delegate where an
ElementMatcher
is applied prior to iteration.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
An iterator that applies a filter to observed elements.Nested classes/interfaces inherited from interface net.bytebuddy.build.Plugin.Engine.Source.Origin
Plugin.Engine.Source.Origin.Filtering, Plugin.Engine.Source.Origin.ForJarFile
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Plugin.Engine.Source.Origin
The origin to which invocations are delegated.private final boolean
true
if the manifest should be retained.private final ElementMatcher<Plugin.Engine.Source.Element>
The element matcher being used to filter elements.Fields inherited from interface net.bytebuddy.build.Plugin.Engine.Source.Origin
NO_MANIFEST
-
Constructor Summary
ConstructorsConstructorDescriptionFiltering
(Plugin.Engine.Source.Origin delegate, ElementMatcher<Plugin.Engine.Source.Element> matcher) Creates a new filtering origin that retains the delegated origin's manifest.Filtering
(Plugin.Engine.Source.Origin delegate, ElementMatcher<Plugin.Engine.Source.Element> matcher, boolean manifest) Creates a new filtering origin. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
delegate
The origin to which invocations are delegated. -
matcher
The element matcher being used to filter elements. -
manifest
private final boolean manifesttrue
if the manifest should be retained.
-
-
Constructor Details
-
Filtering
public Filtering(Plugin.Engine.Source.Origin delegate, ElementMatcher<Plugin.Engine.Source.Element> matcher) Creates a new filtering origin that retains the delegated origin's manifest.- Parameters:
delegate
- The origin to which invocations are delegated.matcher
- The element matcher being used to filter elements.
-
Filtering
public Filtering(Plugin.Engine.Source.Origin delegate, ElementMatcher<Plugin.Engine.Source.Element> matcher, boolean manifest) Creates a new filtering origin.- Parameters:
delegate
- The origin to which invocations are delegated.matcher
- The element matcher being used to filter elements.manifest
-true
if the manifest should be retained.
-
-
Method Details
-
getManifest
Returns the manifest file of the source location ornull
if no manifest exists.- Specified by:
getManifest
in interfacePlugin.Engine.Source.Origin
- Returns:
- This source's manifest or
null
. - Throws:
IOException
- If an I/O error occurs.
-
getClassFileLocator
Returns a class file locator for the represented source. If the class file locator needs to be closed, it is the responsibility of this origin to close the locator or its underlying resources.- Specified by:
getClassFileLocator
in interfacePlugin.Engine.Source.Origin
- Returns:
- A class file locator for locating class files of this instance..
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
iterator
- Specified by:
iterator
in interfaceIterable<Plugin.Engine.Source.Element>
-