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 java.lang.Object implements Plugin.Engine.Source
A source that applies a filter upon iterating elements.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
Plugin.Engine.Source.Filtering.MultiReleaseVersionMatcher
An element matcher that filters multi-release files above a given version.-
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
Fields Modifier and Type Field Description private Plugin.Engine.Source
delegate
The source to which invocations are delegated.private boolean
manifest
true
if the manifest should be retained.private ElementMatcher<Plugin.Engine.Source.Element>
matcher
The element matcher being used to filter elements.
-
Constructor Summary
Constructors Constructor Description Filtering(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Plugin.Engine.Source
dropMultiReleaseClassFilesAbove(Plugin.Engine.Source delegate, ClassFileVersion classFileVersion)
Wraps a source to exclude elements that are above the specified Java version.Plugin.Engine.Source.Origin
read()
Initiates reading from a source.
-
-
-
Field Detail
-
delegate
private final Plugin.Engine.Source delegate
The source to which invocations are delegated.
-
matcher
private final ElementMatcher<Plugin.Engine.Source.Element> matcher
The element matcher being used to filter elements.
-
manifest
private final boolean manifest
true
if the manifest should be retained.
-
-
Constructor Detail
-
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 Detail
-
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.
-
read
public Plugin.Engine.Source.Origin read() throws java.io.IOException
Initiates reading from a source.- Specified by:
read
in interfacePlugin.Engine.Source
- Returns:
- The origin to read from.
- Throws:
java.io.IOException
- If an I/O error occurs.
-
-