Package net.bytebuddy.build
Class Plugin.Engine.Source.Filtering
java.lang.Object
net.bytebuddy.build.Plugin.Engine.Source.Filtering
- All Implemented Interfaces:
Plugin.Engine.Source
- Enclosing interface:
Plugin.Engine.Source
@Enhance
public static class Plugin.Engine.Source.Filtering
extends Object
implements Plugin.Engine.Source
A source that applies a filter upon iterating elements.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
An element matcher that filters multi-release files above a given version.protected static enum
A matcher that removes folders from the iteration.Nested classes/interfaces inherited from interface net.bytebuddy.build.Plugin.Engine.Source
Plugin.Engine.Source.Compound, Plugin.Engine.Source.Element, Plugin.Engine.Source.Empty, Plugin.Engine.Source.Filtering, Plugin.Engine.Source.ForFolder, Plugin.Engine.Source.ForJarFile, Plugin.Engine.Source.InMemory, Plugin.Engine.Source.Origin
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Plugin.Engine.Source
The source 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. -
Constructor Summary
ConstructorsConstructorDescriptionFiltering
(Plugin.Engine.Source delegate, ElementMatcher<Plugin.Engine.Source.Element> matcher) Creates a new filtering source that retains the manifest of the delegated source.Filtering
(Plugin.Engine.Source delegate, ElementMatcher<Plugin.Engine.Source.Element> matcher, boolean manifest) Creates a new filtering source. -
Method Summary
Modifier and TypeMethodDescriptionstatic Plugin.Engine.Source
dropFolders
(Plugin.Engine.Source delegate) Wraps a source to exclude elements that represent folders.static Plugin.Engine.Source
dropMultiReleaseClassFilesAbove
(Plugin.Engine.Source delegate, ClassFileVersion classFileVersion) Wraps a source to exclude elements that are above the specified Java version.read()
Initiates reading from a source.
-
Field Details
-
delegate
The source 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 delegate, ElementMatcher<Plugin.Engine.Source.Element> matcher) Creates a new filtering source that retains the manifest of the delegated source.- Parameters:
delegate
- The source to which invocations are delegated.matcher
- The element matcher being used to filter elements.
-
Filtering
public Filtering(Plugin.Engine.Source delegate, ElementMatcher<Plugin.Engine.Source.Element> matcher, boolean manifest) Creates a new filtering source.- Parameters:
delegate
- The source to which invocations are delegated.matcher
- The element matcher being used to filter elements.manifest
-true
if the manifest should be retained.
-
-
Method Details
-
dropMultiReleaseClassFilesAbove
public static Plugin.Engine.Source dropMultiReleaseClassFilesAbove(Plugin.Engine.Source delegate, ClassFileVersion classFileVersion) Wraps a source to exclude elements that are above the specified Java version.- Parameters:
delegate
- The delegate source.classFileVersion
- The latest multi-release Java version to retain from the source.- Returns:
- A source that applies an appropriate filter.
-
dropFolders
Wraps a source to exclude elements that represent folders.- Parameters:
delegate
- The delegate source.- Returns:
- A source that drops folders and delegates to the original source.
-
read
Initiates reading from a source.- Specified by:
read
in interfacePlugin.Engine.Source
- Returns:
- The origin to read from.
- Throws:
IOException
- If an I/O error occurs.
-