Class PackageInfo
java.lang.Object
io.github.classgraph.PackageInfo
- All Implemented Interfaces:
HasName, Comparable<PackageInfo>
Holds metadata about a package encountered during a scan.
-
Method Summary
Modifier and TypeMethodDescriptionintbooleanGet any annotations on thepackage-info.classfile.getAnnotationInfo(Class<? extends Annotation> annotation) Get a the annotation on this package, or null if the package does not have the annotation.getAnnotationInfo(String annotationName) Get a the named annotation on this package, or null if the package does not have the named annotation.The child packages of this package, or the empty list if none.Get theClassInfoobjects for all classes that are members of this package.getClassInfo(String className) Get theClassInfoobject for the named class in this package, or null if the class was not found in this package.Get theClassInfoobjects for all classes that are members of this package or a sub-package.getName()The package name ("" for the root package).The parent package of this package, or null if this is the root package.booleanhasAnnotation(Class<? extends Annotation> annotation) Check if the package has the annotation.booleanhasAnnotation(String annotationName) Check if the package has the named annotation.inthashCode()toString()
-
Method Details
-
getName
-
getAnnotationInfo
Get a the annotation on this package, or null if the package does not have the annotation.- Parameters:
annotation- The annotation.- Returns:
- An
AnnotationInfoobject representing the annotation on this package, or null if the package does not have the annotation.
-
getAnnotationInfo
Get a the named annotation on this package, or null if the package does not have the named annotation.- Parameters:
annotationName- The annotation name.- Returns:
- An
AnnotationInfoobject representing the named annotation on this package, or null if the package does not have the named annotation.
-
getAnnotationInfo
Get any annotations on thepackage-info.classfile.- Returns:
- the annotations on the
package-info.classfile.
-
hasAnnotation
Check if the package has the annotation.- Parameters:
annotation- The annotation.- Returns:
- true if this package has the annotation.
-
hasAnnotation
Check if the package has the named annotation.- Parameters:
annotationName- The name of an annotation.- Returns:
- true if this package has the named annotation.
-
getParent
The parent package of this package, or null if this is the root package.- Returns:
- the parent package, or null if this is the root package.
-
getChildren
The child packages of this package, or the empty list if none.- Returns:
- the child packages, or the empty list if none.
-
getClassInfo
-
getClassInfo
-
getClassInfoRecursive
-
compareTo
- Specified by:
compareToin interfaceComparable<PackageInfo>
-
hashCode
-
equals
-
toString
-