Package net.bytebuddy.dynamic.loading
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 Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractModuleReader(Map<String, byte[]> types) Creates a new abstract module reader. -
Method Summary
-
Field Details
-
types
The map containing type names and their byte representations.
-
-
Constructor Details
-
AbstractModuleReader
Creates a new abstract module reader.- Parameters:
types- The map of type names to their byte representations.
-
-
Method Details
-
doFind
Finds a resource within the module.- Parameters:
name- The resource name.- Returns:
- An optional containing the resource URI if found, empty otherwise.
-
doList
Lists all resources in the module.- Returns:
- An empty stream as listing is not supported.
-
doOpen
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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-