Class Plugin.Engine.Source.Element.ForJarEntry

java.lang.Object
net.bytebuddy.build.Plugin.Engine.Source.Element.ForJarEntry
All Implemented Interfaces:
Plugin.Engine.Source.Element
Enclosing interface:
Plugin.Engine.Source.Element

@Enhance public static class Plugin.Engine.Source.Element.ForJarEntry extends Object implements Plugin.Engine.Source.Element
Represents a jar file entry as an element.
  • Field Details

    • file

      private final JarFile file
      The source's underlying jar file.
    • entry

      private final JarEntry entry
      The entry that is represented by this element.
  • Constructor Details

    • ForJarEntry

      public ForJarEntry(JarFile file, JarEntry entry)
      Creates a new element representation for a jar file entry.
      Parameters:
      file - The source's underlying jar file.
      entry - The entry that is represented by this element.
  • Method Details

    • getName

      public String getName()
      Returns the element's relative path and name.
      Specified by:
      getName in interface Plugin.Engine.Source.Element
      Returns:
      The element's path and name.
    • getInputStream

      public InputStream getInputStream() throws IOException
      Returns an input stream to read this element's binary information.
      Specified by:
      getInputStream in interface Plugin.Engine.Source.Element
      Returns:
      An input stream that represents this element's binary information.
      Throws:
      IOException - If an I/O error occurs.
    • resolveAs

      @MaybeNull public <T> T resolveAs(Class<T> type)
      Resolves this element to a more specialized form if possible. Doing so allows for performance optimizations if more specialized formats are available.
      Specified by:
      resolveAs in interface Plugin.Engine.Source.Element
      Type Parameters:
      T - The requested spezialized type.
      Parameters:
      type - The requested spezialized type.
      Returns:
      The resolved element or null if a transformation is impossible.