Package io.github.classgraph
Class ModuleInfo
java.lang.Object
io.github.classgraph.ModuleInfo
- All Implemented Interfaces:
HasName,Comparable<ModuleInfo>
Holds metadata about a package encountered during a scan.
-
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(ModuleInfo other) booleanGet any annotations on thepackage-info.classfile.getAnnotationInfo(Class<? extends Annotation> annotation) Get a the annotation on this module, or null if the module does not have the annotation.getAnnotationInfo(String annotationName) Get a the named annotation on this module, or null if the module does not have the named annotation.Get the list ofClassInfoobjects for all classes that are members of this package.getClassInfo(String className) Get theClassInfoobject for the named class in this module, or null if the class was not found in this module.The module location, or null for modules whose location is unknown.TheModuleReffor this module, or null if this module was obtained from a classpath element on the traditional classpath that contained amodule-info.classfile.getName()The module name, or""for the unnamed module.Get thePackageInfoobjects for all packages that are members of this module.getPackageInfo(String packageName) Get thePackageInfoobject for the named package in this module, or null if the package was not found in this module.booleanhasAnnotation(Class<? extends Annotation> annotation) Check if this module has the annotation.booleanhasAnnotation(String annotationName) Check if this module has the named annotation.inthashCode()toString()
-
Method Details
-
getName
The module name, or""for the unnamed module. -
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
TheModuleReffor this module, or null if this module was obtained from a classpath element on the traditional classpath that contained amodule-info.classfile.- Returns:
- the
ModuleRef, or null if this module was obtained from a classpath element on the traditional classpath that contained amodule-info.classfile.
-
getClassInfo
Get theClassInfoobject 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
ClassInfoobject for the named class in this module, or null if the class was not found in this module.
-
getClassInfo
Get the list ofClassInfoobjects for all classes that are members of this package.- Returns:
- the list of
ClassInfoobjects for all classes that are members of this package.
-
getPackageInfo
Get thePackageInfoobject 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
PackageInfoobject for the named package in this module, or null if the package was not found in this module.
-
getPackageInfo
Get thePackageInfoobjects for all packages that are members of this module.- Returns:
- the list of
PackageInfoobjects for all packages that are members of this module.
-
getAnnotationInfo
Get a the annotation on this module, or null if the module does not have the annotation.- Parameters:
annotation- The annotation.- Returns:
- An
AnnotationInfoobject representing the annotation on this module, or null if the module does not have the annotation.
-
getAnnotationInfo
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
AnnotationInfoobject representing the named annotation on this module, or null if the module does not have the named annotation.
-
getAnnotationInfo
Get any annotations on thepackage-info.classfile.- Returns:
- the list of
AnnotationInfoobjects for annotations on thepackage-info.classfile.
-
hasAnnotation
Check if this module has the annotation.- Parameters:
annotation- The annotation.- Returns:
- true if this module has the annotation.
-
hasAnnotation
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
- Specified by:
compareToin interfaceComparable<ModuleInfo>
-
hashCode
public int hashCode() -
equals
-
toString
-