/** * Get the subclasses of this class. * * @return the set of subclasses of this class, or the empty set if none. */ public Set<ClassInfo> getSubclasses() { // Make an exception for querying all subclasses of java.lang.Object return filterClassInfo(getReachableClasses(RelType.SUBCLASSES), /* removeExternalClassesIfStrictWhitelist = */ !className.equals("java.lang.Object"), scanSpec, ClassType.ALL); }
/** * Returns the inner classes contained within this class. Returns the empty set if none. * * @return The set of inner classes within this class. */ public Set<ClassInfo> getInnerClasses() { return filterClassInfo(getReachableClasses(RelType.CONTAINS_INNER_CLASS), /* removeExternalClassesIfStrictWhitelist = */ false, scanSpec, ClassType.ALL); }
/** * Get the names of interface classes found during the scan. * * @return the sorted list of names of interface classes found during the scan, or the empty list if none. */ static List<String> getNamesOfAllInterfaceClasses(final ScanSpec scanSpec, final Set<ClassInfo> allClassInfo) { return getClassNames(filterClassInfo(allClassInfo, /* removeExternalClassesIfStrictWhitelist = */ true, scanSpec, ClassType.IMPLEMENTED_INTERFACE)); }
/** * Get the names of all annotation classes found during the scan. * * @return the sorted list of names of annotation classes found during the scan, or the empty list if none. */ static List<String> getNamesOfAllAnnotationClasses(final ScanSpec scanSpec, final Set<ClassInfo> allClassInfo) { return getClassNames(filterClassInfo(allClassInfo, /* removeExternalClassesIfStrictWhitelist = */ true, scanSpec, ClassType.ANNOTATION)); }
/** * Get the annotations and meta-annotations on this class. This is equivalent to the reflection call * Class#getAnnotations(), except that it does not require calling the classloader, and it returns * meta-annotations as well as annotations. * * @return the set of annotations and meta-annotations on this class or interface, or meta-annotations if this * is an annotation. Returns the empty set if none. */ public Set<ClassInfo> getAnnotations() { return filterClassInfo(getReachableClasses(RelType.CLASS_ANNOTATIONS), /* removeExternalClassesIfStrictWhitelist = */ true, scanSpec, ClassType.ALL); }
/** * Get the method annotations or meta-annotations on this class. * * @return the set of method annotations or meta-annotations on this class, or the empty set if none. */ public Set<ClassInfo> getMethodAnnotations() { return filterClassInfo(getReachableClasses(RelType.METHOD_ANNOTATIONS), /* removeExternalClassesIfStrictWhitelist = */ true, scanSpec, ClassType.ANNOTATION); }
/** * Get the classes that have a method with this annotation or meta-annotation. * * @return the set of classes that have a method with this annotation or meta-annotation, or the empty set if * none. */ public Set<ClassInfo> getClassesWithMethodAnnotation() { return filterClassInfo(getReachableClasses(RelType.CLASSES_WITH_METHOD_ANNOTATION), /* removeExternalClassesIfStrictWhitelist = */ true, scanSpec, ClassType.ALL); }
/** * Get the classes that have a field with this annotation or meta-annotation. * * @return the set of classes that have a field with this annotation or meta-annotation, or the empty set if * none. */ public Set<ClassInfo> getClassesWithFieldAnnotation() { return filterClassInfo(getReachableClasses(RelType.CLASSES_WITH_FIELD_ANNOTATION), /* removeExternalClassesIfStrictWhitelist = */ true, scanSpec, ClassType.ALL); }
/** * Get the classes that have a field with this direct annotation. * * @return the set of classes that have a field with this direct annotation, or the empty set if none. */ public Set<ClassInfo> getClassesWithDirectFieldAnnotation() { return filterClassInfo(getDirectlyRelatedClasses(RelType.CLASSES_WITH_FIELD_ANNOTATION), /* removeExternalClassesIfStrictWhitelist = */ true, scanSpec, ClassType.ALL); }
/** * Get the names of all standard (non-interface/annotation) classes found during the scan, or the empty list if * none. * * @return the sorted unique names of all standard (non-interface/annotation) classes found during the scan, or * the empty list if none. */ static List<String> getNamesOfAllStandardClasses(final ScanSpec scanSpec, final Set<ClassInfo> allClassInfo) { return getClassNames(filterClassInfo(allClassInfo, /* removeExternalClassesIfStrictWhitelist = */ true, scanSpec, ClassType.STANDARD_CLASS)); }
/** * Get the direct subclasses of this class. * * @return the set of direct subclasses of this class, or the empty set if none. */ public Set<ClassInfo> getDirectSubclasses() { // Make an exception for querying all direct subclasses of java.lang.Object return filterClassInfo(getDirectlyRelatedClasses(RelType.SUBCLASSES), /* removeExternalClassesIfStrictWhitelist = */ !className.equals("java.lang.Object"), scanSpec, ClassType.ALL); }
/** * Get the direct method direct annotations on this class. * * @return the set of method direct annotations on this class, or the empty set if none. */ public Set<ClassInfo> getMethodDirectAnnotations() { return filterClassInfo(getDirectlyRelatedClasses(RelType.METHOD_ANNOTATIONS), /* removeExternalClassesIfStrictWhitelist = */ true, scanSpec, ClassType.ANNOTATION); }
/** * Get the classes that have a method with this direct annotation. * * @return the set of classes that have a method with this direct annotation, or the empty set if none. */ public Set<ClassInfo> getClassesWithDirectMethodAnnotation() { return filterClassInfo(getDirectlyRelatedClasses(RelType.CLASSES_WITH_METHOD_ANNOTATION), /* removeExternalClassesIfStrictWhitelist = */ true, scanSpec, ClassType.ALL); }
/** * Get the classes that directly implement this interface, and their subclasses. * * @return the set of classes directly implementing this interface, or the empty set if none. */ public Set<ClassInfo> getClassesDirectlyImplementing() { return !isImplementedInterface() ? Collections.<ClassInfo> emptySet() : filterClassInfo(getDirectlyRelatedClasses(RelType.CLASSES_IMPLEMENTING), /* removeExternalClassesIfStrictWhitelist = */ true, scanSpec, ClassType.STANDARD_CLASS); }
/** * Get the annotations that have this direct meta-annotation. * * @return the set of annotations that have this direct meta-annotation, or the empty set if none. */ public Set<ClassInfo> getAnnotationsWithDirectMetaAnnotation() { return !isAnnotation() ? Collections.<ClassInfo> emptySet() : filterClassInfo(getDirectlyRelatedClasses(RelType.CLASSES_WITH_CLASS_ANNOTATION), /* removeExternalClassesIfStrictWhitelist = */ true, scanSpec, ClassType.ANNOTATION); }
/** * Get the superinterfaces of this interface. * * @return the set of superinterfaces of this interface, or the empty set if none. */ public Set<ClassInfo> getSuperinterfaces() { return !isImplementedInterface() ? Collections.<ClassInfo> emptySet() : filterClassInfo(getReachableClasses(RelType.IMPLEMENTED_INTERFACES), /* removeExternalClassesIfStrictWhitelist = */ true, scanSpec, ClassType.IMPLEMENTED_INTERFACE); }
/** * Get the interfaces directly implemented by this standard class. * * @return the set of interfaces directly implemented by this standard class. Returns the empty set if none. */ public Set<ClassInfo> getDirectlyImplementedInterfaces() { return !isStandardClass() ? Collections.<ClassInfo> emptySet() : filterClassInfo(getDirectlyRelatedClasses(RelType.IMPLEMENTED_INTERFACES), /* removeExternalClassesIfStrictWhitelist = */ true, scanSpec, ClassType.IMPLEMENTED_INTERFACE); }
/** * Get the direct superinterfaces of this interface. * * @return the set of direct superinterfaces of this interface, or the empty set if none. */ public Set<ClassInfo> getDirectSuperinterfaces() { return !isImplementedInterface() ? Collections.<ClassInfo> emptySet() : filterClassInfo(getDirectlyRelatedClasses(RelType.IMPLEMENTED_INTERFACES), /* removeExternalClassesIfStrictWhitelist = */ true, scanSpec, ClassType.IMPLEMENTED_INTERFACE); }
/** * Get the annotations and meta-annotations on this annotation class. * * @return the set of annotations and meta-annotations, if this is an annotation class, or the empty set if none * (or if this is not an annotation class). */ public Set<ClassInfo> getMetaAnnotations() { return !isAnnotation() ? Collections.<ClassInfo> emptySet() : filterClassInfo(getReachableClasses(RelType.CLASS_ANNOTATIONS), /* removeExternalClassesIfStrictWhitelist = */ true, scanSpec, ClassType.ALL); }
/** * Get the annotations that have this meta-annotation. * * @return the set of annotations that have this meta-annotation, or the empty set if none. */ public Set<ClassInfo> getAnnotationsWithMetaAnnotation() { return !isAnnotation() ? Collections.<ClassInfo> emptySet() : filterClassInfo(getReachableClasses(RelType.CLASSES_WITH_CLASS_ANNOTATION), /* removeExternalClassesIfStrictWhitelist = */ true, scanSpec, ClassType.ANNOTATION); }