Class ModuleLayerFromSingleClassLoaderDecorator.AbstractModuleReader

java.lang.Object
net.bytebuddy.dynamic.loading.ModuleLayerFromSingleClassLoaderDecorator.AbstractModuleReader
All Implemented Interfaces:
Closeable, AutoCloseable
Enclosing class:
ModuleLayerFromSingleClassLoaderDecorator

public abstract static class ModuleLayerFromSingleClassLoaderDecorator.AbstractModuleReader extends Object implements Closeable
An abstract implementation of a module reader that provides access to dynamically generated types.

This class serves as a base for creating module readers that can handle byte code representations of classes within a module. It implements the Closeable interface but provides an empty implementation for the close method.

  • Field Details

    • types

      private final Map<String,byte[]> types
      The map containing type names and their byte representations.
  • Constructor Details

    • AbstractModuleReader

      protected AbstractModuleReader(Map<String,byte[]> types)
      Creates a new abstract module reader.
      Parameters:
      types - The map of type names to their byte representations.
  • Method Details

    • doFind

      protected Object doFind(String name)
      Finds a resource within the module.
      Parameters:
      name - The resource name.
      Returns:
      An optional containing the resource URI if found, empty otherwise.
    • doList

      protected Object doList()
      Lists all resources in the module.
      Returns:
      An empty stream as listing is not supported.
    • doOpen

      protected Object doOpen(String name)
      Opens an input stream to a resource within the module.
      Parameters:
      name - The resource name.
      Returns:
      An optional containing the input stream if the resource exists, empty otherwise.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable