public class ClassInfo extends Object implements Comparable<ClassInfo>
Modifier and Type | Method and Description |
---|---|
boolean |
annotatesClass(String annotatedClassName)
Test whether this class annotates the named class.
|
boolean |
annotatesMethodOfClass(String className)
Test whether this annotation annotates a method of the named class.
|
int |
compareTo(ClassInfo o)
Compare based on class name.
|
boolean |
directlyAnnotatesClass(String directlyAnnotatedClassName)
Test whether this class annotates the named class.
|
boolean |
directlyImplementsInterface(String interfaceName)
Test whether this standard class directly implements the named interface, or by one of its superclasses.
|
boolean |
equals(Object obj)
Use class name for equals().
|
Set<ClassInfo> |
getAnnotations()
Get the annotations and meta-annotations on this class.
|
Set<ClassInfo> |
getAnnotationsWithDirectMetaAnnotation()
Get the annotations that have this direct meta-annotation.
|
Set<ClassInfo> |
getAnnotationsWithMetaAnnotation()
Get the annotations that have this meta-annotation.
|
Set<ClassInfo> |
getClassesDirectlyImplementing()
Get the classes that directly implement this interface, and their subclasses.
|
Set<ClassInfo> |
getClassesImplementing()
Get the classes that implement this interface, and their subclasses.
|
Set<ClassInfo> |
getClassesWithAnnotation()
Get the standard classes and non-annotation interfaces that are annotated by this annotation.
|
Set<ClassInfo> |
getClassesWithDirectAnnotation()
Get the standard classes or non-annotation interfaces that are directly annotated with this annotation.
|
Set<ClassInfo> |
getClassesWithMethodAnnotation()
Get the classes that have a method with this annotation.
|
String |
getClassName()
Get the name of this class.
|
static List<String> |
getClassNames(Collection<ClassInfo> classInfoColl)
Get the sorted list of the names of classes given a collection of ClassInfo objects.
|
Set<ClassInfo> |
getDirectAnnotations()
Get the direct annotations and meta-annotations on this class.
|
Set<ClassInfo> |
getDirectlyAnnotatedClasses()
Deprecated.
|
Set<ClassInfo> |
getDirectlyImplementedInterfaces()
Get the interfaces directly implemented by this standard class.
|
Set<ClassInfo> |
getDirectSubclasses()
Get the direct subclasses of this class.
|
Set<ClassInfo> |
getDirectSubinterfaces()
Get the direct subinterfaces of this interface.
|
ClassInfo |
getDirectSuperclass()
Convenience method for getting the single direct superclass of this class.
|
Set<ClassInfo> |
getDirectSuperclasses()
Get the direct superclasses of this class.
|
Set<ClassInfo> |
getDirectSuperinterfaces()
Get the direct superinterfaces of this interface.
|
Set<ClassInfo> |
getFieldTypes()
Get the types of this class' fields.
|
Set<ClassInfo> |
getImplementedInterfaces()
Get the interfaces implemented by this standard class, or by one of its superclasses.
|
Set<ClassInfo> |
getMetaAnnotations()
Get the annotations and meta-annotations on this annotation class.
|
Set<ClassInfo> |
getMethodAnnotations()
Get the method annotations on this class.
|
String |
getNameOfDirectSuperclass()
Convenience method for getting the name of the single direct superclass of this class.
|
List<String> |
getNamesOfAnnotations()
Get the names of annotations and meta-annotations on this class.
|
List<String> |
getNamesOfAnnotationsWithDirectMetaAnnotation()
Get the names of annotations that have this direct meta-annotation.
|
List<String> |
getNamesOfAnnotationsWithMetaAnnotation()
Get the names of annotations that have this meta-annotation.
|
List<String> |
getNamesOfClassesDirectlyImplementing()
Get the names of classes that directly implement this interface, and the names of their subclasses.
|
List<String> |
getNamesOfClassesImplementing()
Get the names of classes that implement this interface, and the names of their subclasses.
|
List<String> |
getNamesOfClassesWithAnnotation()
Get the names of standard classes and non-annotation interfaces that are annotated by this annotation.
|
List<String> |
getNamesOfClassesWithDirectAnnotation()
Get the names of standard classes or non-annotation interfaces that are directly annotated with this
annotation.
|
List<String> |
getNamesOfClassesWithMethodAnnotation()
Get the names of classes that have a method with this annotation.
|
List<String> |
getNamesOfDirectAnnotations()
Get the names of direct annotations and meta-annotations on this class.
|
List<String> |
getNamesOfDirectlyAnnotatedClasses()
Deprecated.
|
List<String> |
getNamesOfDirectlyImplementedInterfaces()
Get the interfaces directly implemented by this standard class, or by one of its superclasses.
|
List<String> |
getNamesOfDirectSubclasses()
Get the names of direct subclasses of this class.
|
List<String> |
getNamesOfDirectSubinterfaces()
Get the names of direct subinterfaces of this interface.
|
List<String> |
getNamesOfDirectSuperclasses()
Get the names of direct superclasses of this class.
|
List<String> |
getNamesOfDirectSuperinterfaces()
Get the names of direct superinterfaces of this interface.
|
List<String> |
getNamesOfFieldTypes()
Get the names of the types of this class' fields.
|
List<String> |
getNamesOfImplementedInterfaces()
Get the interfaces implemented by this standard class, or by one of its superclasses.
|
List<String> |
getNamesOfMetaAnnotations()
Get the names of annotations and meta-annotations on this annotation class.
|
List<String> |
getNamesOfMethodAnnotations()
Get the names of method annotations on this class.
|
List<String> |
getNamesOfSubclasses()
Get the names of subclasses of this class.
|
List<String> |
getNamesOfSubinterfaces()
Get the names of subinterfaces of this interface.
|
List<String> |
getNamesOfSuperclasses()
Get the names of all direct and indirect superclasses of this class (i.e.
|
List<String> |
getNamesOfSuperinterfaces()
Get the names of superinterfaces of this interface.
|
Set<ClassInfo> |
getSubclasses()
Get the subclasses of this class.
|
Set<ClassInfo> |
getSubinterfaces()
Get the subinterfaces of this interface.
|
Set<ClassInfo> |
getSuperclasses()
Get all direct and indirect superclasses of this class (i.e.
|
Set<ClassInfo> |
getSuperinterfaces()
Get the superinterfaces of this interface.
|
boolean |
hasAnnotation(String annotationName)
Test whether this class, interface or annotation has the named class annotation or meta-annotation.
|
boolean |
hasDirectAnnotation(String directAnnotationName)
Test whether this class has the named direct annotation or meta-annotation.
|
boolean |
hasDirectMetaAnnotation(String directMetaAnnotationName)
Test whether this annotation is directly meta-annotated with the named annotation.
|
boolean |
hasDirectSubclass(String directSubclassName)
Test whether this class has the named direct subclass.
|
boolean |
hasDirectSubinterface(String directSubinterfaceName)
Test whether this class is and interface and has the named direct subinterface.
|
boolean |
hasDirectSuperclass(String directSuperclassName)
Test whether this class directly extends the named superclass.
|
boolean |
hasDirectSuperinterface(String directSuperinterfaceName)
Test whether this class is an interface and has the named direct superinterface.
|
int |
hashCode()
Use hash code of class name.
|
boolean |
hasMetaAnnotation(String metaAnnotationName)
Test whether this is an annotation class and it has the named meta-annotation.
|
boolean |
hasMethodWithAnnotation(String annotationName)
Test whether this class has a method with the named method annotation.
|
boolean |
hasSubclass(String subclassName)
Test whether this class has the named class as a subclass.
|
boolean |
hasSubinterface(String subinterfaceName)
Test whether this class is has the named subinterface.
|
boolean |
hasSuperclass(String superclassName)
Test whether this class extends the named superclass, directly or indirectly.
|
boolean |
hasSuperinterface(String superinterfaceName)
Test whether this class is an interface and has the named superinterface.
|
boolean |
implementsInterface(String interfaceName)
Test whether this standard class implements the named interface, or by one of its superclasses.
|
boolean |
isAnnotation()
Test whether this classInfo is an annotation.
|
boolean |
isDirectlyImplementedByClass(String className)
Test whether this class is directly implemented by the named class, or by one of its superclasses.
|
boolean |
isImplementedByClass(String className)
Test whether this class is implemented by the named class, or by one of its superclasses.
|
boolean |
isImplementedInterface()
Test whether this class is an "implemented interface" (meaning a standard, non-annotation interface, or an
annotation that has also been implemented as an interface by some class).
|
boolean |
isStandardClass()
Test whether this class is a standard class (not an annotation or interface).
|
boolean |
metaAnnotatesAnnotation(String annotationName)
Test whether this annotation has the named meta-annotation.
|
String |
toString() |
public String getClassName()
public int compareTo(ClassInfo o)
compareTo
in interface Comparable<ClassInfo>
public boolean equals(Object obj)
public static List<String> getClassNames(Collection<ClassInfo> classInfoColl)
public boolean isStandardClass()
public Set<ClassInfo> getSubclasses()
public List<String> getNamesOfSubclasses()
public boolean hasSubclass(String subclassName)
public Set<ClassInfo> getDirectSubclasses()
public List<String> getNamesOfDirectSubclasses()
public boolean hasDirectSubclass(String directSubclassName)
public Set<ClassInfo> getSuperclasses()
public List<String> getNamesOfSuperclasses()
public boolean hasSuperclass(String superclassName)
public Set<ClassInfo> getDirectSuperclasses()
public ClassInfo getDirectSuperclass()
IllegalArgumentException
- if there are multiple direct superclasses of this class (in the case of Scala mixins).public List<String> getNamesOfDirectSuperclasses()
public String getNameOfDirectSuperclass()
IllegalArgumentException
- if there are multiple direct superclasses of this class (in the case of Scala mixins).public boolean hasDirectSuperclass(String directSuperclassName)
directSuperclassName
- The direct superclass name to match. If null, matches classes without a direct superclass (e.g.
interfaces). Note that standard classes that do not extend another class have java.lang.Object as
their superclass.public boolean isImplementedInterface()
public Set<ClassInfo> getSubinterfaces()
public List<String> getNamesOfSubinterfaces()
public boolean hasSubinterface(String subinterfaceName)
public Set<ClassInfo> getDirectSubinterfaces()
public List<String> getNamesOfDirectSubinterfaces()
public boolean hasDirectSubinterface(String directSubinterfaceName)
public Set<ClassInfo> getSuperinterfaces()
public List<String> getNamesOfSuperinterfaces()
public boolean hasSuperinterface(String superinterfaceName)
public Set<ClassInfo> getDirectSuperinterfaces()
public List<String> getNamesOfDirectSuperinterfaces()
public boolean hasDirectSuperinterface(String directSuperinterfaceName)
public Set<ClassInfo> getImplementedInterfaces()
public List<String> getNamesOfImplementedInterfaces()
public boolean implementsInterface(String interfaceName)
public Set<ClassInfo> getDirectlyImplementedInterfaces()
public List<String> getNamesOfDirectlyImplementedInterfaces()
public boolean directlyImplementsInterface(String interfaceName)
public Set<ClassInfo> getClassesImplementing()
public List<String> getNamesOfClassesImplementing()
public boolean isImplementedByClass(String className)
public Set<ClassInfo> getClassesDirectlyImplementing()
public List<String> getNamesOfClassesDirectlyImplementing()
public boolean isDirectlyImplementedByClass(String className)
public boolean isAnnotation()
public Set<ClassInfo> getClassesWithAnnotation()
public List<String> getNamesOfClassesWithAnnotation()
public boolean annotatesClass(String annotatedClassName)
@Deprecated public Set<ClassInfo> getDirectlyAnnotatedClasses()
public Set<ClassInfo> getClassesWithDirectAnnotation()
@Deprecated public List<String> getNamesOfDirectlyAnnotatedClasses()
public List<String> getNamesOfClassesWithDirectAnnotation()
public boolean directlyAnnotatesClass(String directlyAnnotatedClassName)
public Set<ClassInfo> getAnnotations()
public List<String> getNamesOfAnnotations()
public boolean hasAnnotation(String annotationName)
public Set<ClassInfo> getDirectAnnotations()
public List<String> getNamesOfDirectAnnotations()
public boolean hasDirectAnnotation(String directAnnotationName)
public Set<ClassInfo> getMetaAnnotations()
public List<String> getNamesOfMetaAnnotations()
public boolean hasMetaAnnotation(String metaAnnotationName)
public Set<ClassInfo> getAnnotationsWithMetaAnnotation()
public List<String> getNamesOfAnnotationsWithMetaAnnotation()
public boolean metaAnnotatesAnnotation(String annotationName)
public Set<ClassInfo> getAnnotationsWithDirectMetaAnnotation()
public List<String> getNamesOfAnnotationsWithDirectMetaAnnotation()
public boolean hasDirectMetaAnnotation(String directMetaAnnotationName)
public Set<ClassInfo> getMethodAnnotations()
public List<String> getNamesOfMethodAnnotations()
public boolean hasMethodWithAnnotation(String annotationName)
public Set<ClassInfo> getClassesWithMethodAnnotation()
public List<String> getNamesOfClassesWithMethodAnnotation()
public boolean annotatesMethodOfClass(String className)
public Set<ClassInfo> getFieldTypes()
Copyright © 2017. All rights reserved.