Package io.github.classgraph
Class PackageInfo
- java.lang.Object
-
- io.github.classgraph.PackageInfo
-
- All Implemented Interfaces:
java.lang.Comparable<PackageInfo>
public class PackageInfo extends java.lang.Object implements java.lang.Comparable<PackageInfo>
Holds metadata about a package encountered during a scan.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(PackageInfo o)booleanequals(java.lang.Object o)AnnotationInfoListgetAnnotationInfo()Get any annotations on thepackage-info.classfile.AnnotationInfogetAnnotationInfo(java.lang.String annotationName)Get a the named annotation on this package, or null if the package does not have the named annotation.PackageInfoListgetChildren()The child packages of this package, or the empty list if none.ClassInfoListgetClassInfo()Get theClassInfoobjects for all classes that are members of this package.ClassInfogetClassInfo(java.lang.String className)Get theClassInfoobject for the named class in this package, or null if the class was not found in this module.ClassInfoListgetClassInfoRecursive()Get theClassInfoobjects for all classes that are members of this package or a sub-package.java.lang.StringgetName()The package name ("" for the root package).PackageInfogetParent()The parent package of this package, or null if this is the root package.booleanhasAnnotation(java.lang.String annotationName)inthashCode()java.lang.StringtoString()
-
-
-
Method Detail
-
getName
public java.lang.String getName()
The package name ("" for the root package).
-
getAnnotationInfo
public AnnotationInfo getAnnotationInfo(java.lang.String annotationName)
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
public AnnotationInfoList getAnnotationInfo()
Get any annotations on thepackage-info.classfile.
-
hasAnnotation
public boolean hasAnnotation(java.lang.String annotationName)
- Parameters:
annotationName- The name of an annotation.- Returns:
- true if this package has the named annotation.
-
getParent
public PackageInfo getParent()
The parent package of this package, or null if this is the root package.
-
getChildren
public PackageInfoList getChildren()
The child packages of this package, or the empty list if none.
-
getClassInfo
public ClassInfo getClassInfo(java.lang.String className)
Get theClassInfoobject for the named class in this package, or null if the class was not found in this module.
-
getClassInfo
public ClassInfoList getClassInfo()
Get theClassInfoobjects for all classes that are members of this package.
-
getClassInfoRecursive
public ClassInfoList getClassInfoRecursive()
Get theClassInfoobjects for all classes that are members of this package or a sub-package.
-
compareTo
public int compareTo(PackageInfo o)
- Specified by:
compareToin interfacejava.lang.Comparable<PackageInfo>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-