| Constructor and Description |
|---|
ModuleRef(java.lang.Object moduleReference,
java.lang.Object moduleLayer)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(ModuleRef o) |
boolean |
equals(java.lang.Object obj) |
java.lang.ClassLoader |
getClassLoader()
Get the class loader for the module.
|
java.lang.Object |
getDescriptor()
Get the module descriptor, i.e.
|
java.lang.Object |
getLayer()
Get the module layer (of JPMS type ModuleLayer).
|
java.net.URI |
getLocation()
Get the module location, i.e.
|
java.io.File |
getLocationFile()
Get the module location as a File, i.e.
|
java.lang.String |
getLocationStr()
Get the module location as a string, i.e.
|
java.lang.String |
getName()
Get the module name, i.e.
|
java.util.List<java.lang.String> |
getPackages()
Get a list of packages in the module.
|
java.lang.String |
getRawVersion()
Get the raw version string of the module, or null if the module did not provide one.
|
java.lang.Object |
getReference()
Get the module reference (of JPMS type ModuleReference).
|
int |
hashCode() |
boolean |
isSystemModule()
Checks if this module is a system module.
|
ModuleReaderProxy |
open()
Open the module, returning a
ModuleReaderProxy. |
java.lang.String |
toString() |
public ModuleRef(java.lang.Object moduleReference,
java.lang.Object moduleLayer)
moduleReference - The module reference, of JPMS type ModuleReference.moduleLayer - The module layer, of JPMS type ModuleLayerpublic java.lang.String getName()
getReference().descriptor().name().getReference().descriptor().name(). Potentially null or empty.public java.lang.Object getReference()
public java.lang.Object getLayer()
public java.lang.Object getDescriptor()
getReference().descriptor() (of JPMS type ModuleDescriptor).getReference().descriptor() (of JPMS type ModuleDescriptor).public java.util.List<java.lang.String> getPackages()
public java.net.URI getLocation()
getReference().location(). Returns null for modules that do not have a
location.getReference().location(). Returns null for modules that do not
have a location.public java.lang.String getLocationStr()
getReference().location().toString(). Returns null for
modules that do not have a location.getReference().location().toString(). Returns null for
modules that do not have a location.public java.io.File getLocationFile()
new File(getReference().location()). Returns null for modules
that do not have a location, or for system (or jlinked) modules, which have "jrt:" location URIs that include
only the module name and not the module jar location.new File(getReference().location()). Returns null for
modules that do not have a location, or for modules whole location is a "jrt:" URI.public java.lang.String getRawVersion()
ModuleReference#rawVersion().orElse(null).public boolean isSystemModule()
public java.lang.ClassLoader getClassLoader()
moduleLayer.findLoader(getReference().descriptor().name()).public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic int compareTo(ModuleRef o)
compareTo in interface java.lang.Comparable<ModuleRef>public ModuleReaderProxy open() throws java.io.IOException
ModuleReaderProxy.ModuleReaderProxy for the module.java.io.IOException - If the module cannot be opened.