public class ModuleInfo extends Object implements Comparable<ModuleInfo>, HasName
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(ModuleInfo other) |
boolean |
equals(Object obj) |
AnnotationInfoList |
getAnnotationInfo()
Get any annotations on the
package-info.class file. |
AnnotationInfo |
getAnnotationInfo(Class<? extends Annotation> annotation)
Get a the annotation on this module, or null if the module does not have the annotation.
|
AnnotationInfo |
getAnnotationInfo(String annotationName)
Get a the named annotation on this module, or null if the module does not have the named annotation.
|
ClassInfoList |
getClassInfo()
Get the list of
ClassInfo objects for all classes that are members of this package. |
ClassInfo |
getClassInfo(String className)
Get the
ClassInfo object for the named class in this module, or null if the class was not found in
this module. |
URI |
getLocation()
The module location, or null for modules whose location is unknown.
|
ModuleRef |
getModuleRef()
The
ModuleRef for this module, or null if this module was obtained from a classpath element on the
traditional classpath that contained a module-info.class file. |
String |
getName()
The module name, or
"" for the unnamed module. |
PackageInfoList |
getPackageInfo()
Get the
PackageInfo objects for all packages that are members of this module. |
PackageInfo |
getPackageInfo(String packageName)
Get the
PackageInfo object for the named package in this module, or null if the package was not found
in this module. |
boolean |
hasAnnotation(Class<? extends Annotation> annotation)
Check if this module has the annotation.
|
boolean |
hasAnnotation(String annotationName)
Check if this module has the named annotation.
|
int |
hashCode() |
String |
toString() |
public String getName()
"" for the unnamed module.public URI getLocation()
public ModuleRef getModuleRef()
ModuleRef for this module, or null if this module was obtained from a classpath element on the
traditional classpath that contained a module-info.class file.ModuleRef, or null if this module was obtained from a classpath element on the
traditional classpath that contained a module-info.class file.public ClassInfo getClassInfo(String className)
ClassInfo object for the named class in this module, or null if the class was not found in
this module.className - the class nameClassInfo object for the named class in this module, or null if the class was not found
in this module.public ClassInfoList getClassInfo()
ClassInfo objects for all classes that are members of this package.ClassInfo objects for all classes that are members of this package.public PackageInfo getPackageInfo(String packageName)
PackageInfo object for the named package in this module, or null if the package was not found
in this module.packageName - the package namePackageInfo object for the named package in this module, or null if the package was not
found in this module.public PackageInfoList getPackageInfo()
PackageInfo objects for all packages that are members of this module.PackageInfo objects for all packages that are members of this module.public AnnotationInfo getAnnotationInfo(Class<? extends Annotation> annotation)
annotation - The annotation.AnnotationInfo object representing the annotation on this module, or null if the module
does not have the annotation.public AnnotationInfo getAnnotationInfo(String annotationName)
annotationName - The annotation name.AnnotationInfo object representing the named annotation on this module, or null if the
module does not have the named annotation.public AnnotationInfoList getAnnotationInfo()
package-info.class file.AnnotationInfo objects for annotations on the package-info.class file.public boolean hasAnnotation(Class<? extends Annotation> annotation)
annotation - The annotation.public boolean hasAnnotation(String annotationName)
annotationName - The name of an annotation.public int compareTo(ModuleInfo other)
compareTo in interface Comparable<ModuleInfo>Copyright © 2021. All rights reserved.