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.
  • Field Details

    • delegate

      private final Plugin.Engine.Source delegate
      The source to which invocations are delegated.
    • matcher

      The element matcher being used to filter elements.
    • manifest

      private final boolean manifest
      true 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

      public static Plugin.Engine.Source dropFolders(Plugin.Engine.Source delegate)
      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 interface Plugin.Engine.Source
      Returns:
      The origin to read from.
      Throws:
      IOException - If an I/O error occurs.