public class PackageInfo extends Object implements Comparable<PackageInfo>, HasName
Modifier and Type | Method and Description |
---|---|
int |
compareTo(PackageInfo o) |
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 package, or null if the package does not have the annotation.
|
AnnotationInfo |
getAnnotationInfo(String annotationName)
Get a the named annotation on this package, or null if the package does not have the named annotation.
|
PackageInfoList |
getChildren()
The child packages of this package, or the empty list if none.
|
ClassInfoList |
getClassInfo()
Get the
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 package, or null if the class was not found in
this package. |
ClassInfoList |
getClassInfoRecursive()
Get the
ClassInfo objects for all classes that are members of this package or a sub-package. |
String |
getName()
The package name ("" for the root package).
|
PackageInfo |
getParent()
The parent package of this package, or null if this is the root package.
|
boolean |
hasAnnotation(Class<? extends Annotation> annotation)
Check if the package has the annotation.
|
boolean |
hasAnnotation(String annotationName)
Check if the package has the named annotation.
|
int |
hashCode() |
String |
toString() |
public String getName()
public AnnotationInfo getAnnotationInfo(Class<? extends Annotation> annotation)
annotation
- The annotation.AnnotationInfo
object representing the annotation on this package, or null if the package
does not have the annotation.public AnnotationInfo getAnnotationInfo(String annotationName)
annotationName
- The annotation name.AnnotationInfo
object representing the named annotation on this package, or null if the
package does not have the named annotation.public AnnotationInfoList getAnnotationInfo()
package-info.class
file.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 PackageInfo getParent()
public PackageInfoList getChildren()
public ClassInfo getClassInfo(String className)
ClassInfo
object for the named class in this package, or null if the class was not found in
this package.className
- the class nameClassInfo
object for the named class in this package, or null if the class was not found
in this package.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 ClassInfoList getClassInfoRecursive()
ClassInfo
objects for all classes that are members of this package or a sub-package.ClassInfo
objects for all classes that are members of this package or a sub-package.public int compareTo(PackageInfo o)
compareTo
in interface Comparable<PackageInfo>
Copyright © 2021. All rights reserved.