Package net.bytebuddy.dynamic.loading
Class ModuleLayerFromSingleClassLoaderDecorator.AbstractModuleReader
- java.lang.Object
-
- net.bytebuddy.dynamic.loading.ModuleLayerFromSingleClassLoaderDecorator.AbstractModuleReader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Enclosing class:
- ModuleLayerFromSingleClassLoaderDecorator
public abstract static class ModuleLayerFromSingleClassLoaderDecorator.AbstractModuleReader extends java.lang.Object implements java.io.CloseableAn 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
Closeableinterface but provides an empty implementation for the close method.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,byte[]>typesThe map containing type names and their byte representations.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractModuleReader(java.util.Map<java.lang.String,byte[]> types)Creates a new abstract module reader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected java.lang.ObjectdoFind(java.lang.String name)Finds a resource within the module.protected java.lang.ObjectdoList()Lists all resources in the module.protected java.lang.ObjectdoOpen(java.lang.String name)Opens an input stream to a resource within the module.
-
-
-
Method Detail
-
doFind
protected java.lang.Object doFind(java.lang.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 java.lang.Object doList()
Lists all resources in the module.- Returns:
- An empty stream as listing is not supported.
-
doOpen
protected java.lang.Object doOpen(java.lang.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:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-