Package org.apache.xbean.finder
Class AbstractFinder
java.lang.Object
org.apache.xbean.finder.AbstractFinder
- All Implemented Interfaces:
IAnnotationFinder
- Direct Known Subclasses:
ClassFinder
- Version:
- $Rev: 1881759 $ $Date: 2020-09-16 10:29:43 +0200 (Wed, 16 Sep 2020) $
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
class
class
class
static interface
class
class
class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<String,
AbstractFinder.ClassInfo> protected final Map<String,
AbstractFinder.ClassInfo> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindAnnotatedClasses
(Class<? extends Annotation> annotation) findAnnotatedConstructors
(Class<? extends Annotation> annotation) findAnnotatedFields
(Class<? extends Annotation> annotation) findAnnotatedMethods
(Class<? extends Annotation> annotation) findAnnotatedPackages
(Class<? extends Annotation> annotation) findClassesInPackage
(String packageName, boolean recursive) findImplementations
(Class<T> clazz) findInheritedAnnotatedClasses
(Class<? extends Annotation> annotation) Naive implementation - works extremelly slow O(n^3)findMetaAnnotatedClasses
(Class<? extends Annotation> annotation) findMetaAnnotatedFields
(Class<? extends Annotation> annotation) findMetaAnnotatedMethods
(Class<? extends Annotation> annotation) findSubclasses
(Class<T> clazz) protected List<AbstractFinder.Info>
getAnnotationInfos
(String name) Returns a list of classes that could not be loaded in last invoked findAnnotated* method.protected abstract URL
getResource
(String className) boolean
isAnnotationPresent
(Class<? extends Annotation> annotation) link()
The link() method must be called to successfully use the findSubclasses and findImplementations methodsprotected abstract Class<?>
protected void
protected void
readClassDef
(InputStream in, String path) protected void
readClassDef
(Class clazz) protected void
readClassDef
(String className)
-
Field Details
-
classInfos
-
originalInfos
-
-
Constructor Details
-
AbstractFinder
public AbstractFinder()
-
-
Method Details
-
getResource
-
loadClass
- Throws:
ClassNotFoundException
-
getAnnotatedClassNames
- Specified by:
getAnnotatedClassNames
in interfaceIAnnotationFinder
-
link
The link() method must be called to successfully use the findSubclasses and findImplementations methods- Returns:
- Throws:
IOException
-
isAnnotationPresent
- Specified by:
isAnnotationPresent
in interfaceIAnnotationFinder
-
getClassesNotLoaded
Returns a list of classes that could not be loaded in last invoked findAnnotated* method. The list will only contain entries of classes whose byte code matched the requirements of last invoked find* method, but were unable to be loaded and included in the results. The list returned is unmodifiable. Once obtained, the returned list will be a live view of the results from the last findAnnotated* method call. This method is not thread safe.- Specified by:
getClassesNotLoaded
in interfaceIAnnotationFinder
- Returns:
- an unmodifiable live view of classes that could not be loaded in previous findAnnotated* call.
-
findAnnotatedPackages
- Specified by:
findAnnotatedPackages
in interfaceIAnnotationFinder
-
findAnnotatedClasses
- Specified by:
findAnnotatedClasses
in interfaceIAnnotationFinder
-
findMetaAnnotatedClasses
- Specified by:
findMetaAnnotatedClasses
in interfaceIAnnotationFinder
-
findInheritedAnnotatedClasses
Naive implementation - works extremelly slow O(n^3)- Specified by:
findInheritedAnnotatedClasses
in interfaceIAnnotationFinder
- Parameters:
annotation
-- Returns:
- list of directly or indirectly (inherited) annotated classes
-
findAnnotatedMethods
- Specified by:
findAnnotatedMethods
in interfaceIAnnotationFinder
-
findMetaAnnotatedMethods
- Specified by:
findMetaAnnotatedMethods
in interfaceIAnnotationFinder
-
findAnnotatedConstructors
- Specified by:
findAnnotatedConstructors
in interfaceIAnnotationFinder
-
findAnnotatedFields
- Specified by:
findAnnotatedFields
in interfaceIAnnotationFinder
-
findMetaAnnotatedFields
- Specified by:
findMetaAnnotatedFields
in interfaceIAnnotationFinder
-
findClassesInPackage
- Specified by:
findClassesInPackage
in interfaceIAnnotationFinder
-
findSubclasses
- Specified by:
findSubclasses
in interfaceIAnnotationFinder
-
findImplementations
- Specified by:
findImplementations
in interfaceIAnnotationFinder
-
getAnnotationInfos
-
readClassDef
-
readClassDef
- Throws:
IOException
-
readClassDef
- Throws:
IOException
-
readClassDef
-