Package net.bytebuddy.build
Class Plugin.Engine.Source.Origin.Filtering
- java.lang.Object
-
- net.bytebuddy.build.Plugin.Engine.Source.Origin.Filtering
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.lang.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 java.lang.Object implements Plugin.Engine.Source.Origin
An origin that forwards all invocations to a delegate where anElementMatcheris applied prior to iteration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classPlugin.Engine.Source.Origin.Filtering.FilteringIteratorAn 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
Fields Modifier and Type Field Description private Plugin.Engine.Source.OrigindelegateThe origin to which invocations are delegated.private booleanmanifesttrueif the manifest should be retained.private ElementMatcher<Plugin.Engine.Source.Element>matcherThe element matcher being used to filter elements.-
Fields inherited from interface net.bytebuddy.build.Plugin.Engine.Source.Origin
NO_MANIFEST
-
-
Constructor Summary
Constructors Constructor Description Filtering(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()ClassFileLocatorgetClassFileLocator()Returns a class file locator for the represented source.java.util.jar.ManifestgetManifest()Returns the manifest file of the source location ornullif no manifest exists.java.util.Iterator<Plugin.Engine.Source.Element>iterator()
-
-
-
Field Detail
-
delegate
private final Plugin.Engine.Source.Origin delegate
The origin 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
trueif the manifest should be retained.
-
-
Constructor Detail
-
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-trueif the manifest should be retained.
-
-
Method Detail
-
getManifest
public java.util.jar.Manifest getManifest() throws java.io.IOExceptionReturns the manifest file of the source location ornullif no manifest exists.- Specified by:
getManifestin interfacePlugin.Engine.Source.Origin- Returns:
- This source's manifest or
null. - Throws:
java.io.IOException- If an I/O error occurs.
-
getClassFileLocator
public ClassFileLocator 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:
getClassFileLocatorin interfacePlugin.Engine.Source.Origin- Returns:
- A class file locator for locating class files of this instance..
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
iterator
public java.util.Iterator<Plugin.Engine.Source.Element> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<Plugin.Engine.Source.Element>
-
-