Package io.github.classgraph
Class ModuleInfo
- java.lang.Object
-
- io.github.classgraph.ModuleInfo
-
- All Implemented Interfaces:
HasName
,java.lang.Comparable<ModuleInfo>
public class ModuleInfo extends java.lang.Object implements java.lang.Comparable<ModuleInfo>, HasName
Holds metadata about a package encountered during a scan.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(ModuleInfo other)
boolean
equals(java.lang.Object obj)
AnnotationInfoList
getAnnotationInfo()
Get any annotations on thepackage-info.class
file.AnnotationInfo
getAnnotationInfo(java.lang.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 ofClassInfo
objects for all classes that are members of this package.ClassInfo
getClassInfo(java.lang.String className)
Get theClassInfo
object for the named class in this module, or null if the class was not found in this module.java.net.URI
getLocation()
The module location, or null for modules whose location is unknown.ModuleRef
getModuleRef()
TheModuleRef
for this module, or null if this module was obtained from a classpath element on the traditional classpath that contained amodule-info.class
file.java.lang.String
getName()
The module name, or""
for the unnamed module.PackageInfoList
getPackageInfo()
Get thePackageInfo
objects for all packages that are members of this module.PackageInfo
getPackageInfo(java.lang.String packageName)
Get thePackageInfo
object for the named package in this module, or null if the package was not found in this module.boolean
hasAnnotation(java.lang.String annotationName)
Check if this module has the named annotation.int
hashCode()
java.lang.String
toString()
-
-
-
Method Detail
-
getName
public java.lang.String getName()
The module name, or""
for the unnamed module.
-
getLocation
public java.net.URI getLocation()
The module location, or null for modules whose location is unknown.- Returns:
- the module location, or null for modules whose location is unknown.
-
getModuleRef
public ModuleRef getModuleRef()
TheModuleRef
for this module, or null if this module was obtained from a classpath element on the traditional classpath that contained amodule-info.class
file.- Returns:
- the
ModuleRef
, or null if this module was obtained from a classpath element on the traditional classpath that contained amodule-info.class
file.
-
getClassInfo
public ClassInfo getClassInfo(java.lang.String className)
Get theClassInfo
object for the named class in this module, or null if the class was not found in this module.- Parameters:
className
- the class name- Returns:
- the
ClassInfo
object for the named class in this module, or null if the class was not found in this module.
-
getClassInfo
public ClassInfoList getClassInfo()
Get the list ofClassInfo
objects for all classes that are members of this package.- Returns:
- the list of
ClassInfo
objects for all classes that are members of this package.
-
getPackageInfo
public PackageInfo getPackageInfo(java.lang.String packageName)
Get thePackageInfo
object for the named package in this module, or null if the package was not found in this module.- Parameters:
packageName
- the package name- Returns:
- the
PackageInfo
object for the named package in this module, or null if the package was not found in this module.
-
getPackageInfo
public PackageInfoList getPackageInfo()
Get thePackageInfo
objects for all packages that are members of this module.- Returns:
- the list of
PackageInfo
objects for all packages that are members of this module.
-
getAnnotationInfo
public AnnotationInfo getAnnotationInfo(java.lang.String annotationName)
Get a the named annotation on this module, or null if the module does not have the named annotation.- Parameters:
annotationName
- The annotation name.- Returns:
- An
AnnotationInfo
object representing the named annotation on this module, or null if the module does not have the named annotation.
-
getAnnotationInfo
public AnnotationInfoList getAnnotationInfo()
Get any annotations on thepackage-info.class
file.- Returns:
- the list of
AnnotationInfo
objects for annotations on thepackage-info.class
file.
-
hasAnnotation
public boolean hasAnnotation(java.lang.String annotationName)
Check if this module has the named annotation.- Parameters:
annotationName
- The name of an annotation.- Returns:
- true if this module has the named annotation.
-
compareTo
public int compareTo(ModuleInfo other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<ModuleInfo>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-