A module reference is a concrete implementation of this class that
implements the abstract methods defined by this class. It contains the
module's descriptor and its location, if known. It also has the ability to
create a ModuleReader
in order to access the module's content, which
may be inside the Java run-time system itself or in an artifact such as a
modular JAR file.
ModuleFinder
, ModuleReader
Modifier and Type | Field and Description |
---|---|
private final ModuleDescriptor | |
private final URI |
Access | Constructor and Description |
---|---|
protected | ModuleReference(ModuleDescriptor
The module descriptor descriptor, URI The module location or location)null if not knownConstructs a new instance of this class. |
Modifier and Type | Method and Description |
---|---|
public final ModuleDescriptor | |
public final Optional | Returns: The location or an emptyOptional if not knownReturns the location of this module's content, if known. |
public abstract ModuleReader |
descriptor | back to summary |
---|---|
private final ModuleDescriptor descriptor |
location | back to summary |
---|---|
private final URI location |
ModuleReference | back to summary |
---|---|
protected ModuleReference(ModuleDescriptor descriptor, URI location) Constructs a new instance of this class.
|
descriptor | back to summary |
---|---|
public final ModuleDescriptor descriptor() Returns the module descriptor.
|
location | back to summary |
---|---|
public final Optional Returns the location of this module's content, if known. This URI, when present, can be used as the location value of a |
open | back to summary |
---|---|
public abstract ModuleReader open() throws IOException Opens the module content for reading.
|