IAnnotationFinder
BundleAnnotationFinder
, ClassFinder
public abstract class AbstractFinder extends Object implements IAnnotationFinder
Modifier and Type | Class | Description |
---|---|---|
class |
AbstractFinder.Annotatable |
|
class |
AbstractFinder.AnnotationInfo |
|
class |
AbstractFinder.ClassInfo |
|
class |
AbstractFinder.FieldInfo |
|
static class |
AbstractFinder.GenericAwareInfoBuildingVisitor |
|
static interface |
AbstractFinder.Info |
|
class |
AbstractFinder.InfoBuildingVisitor |
|
class |
AbstractFinder.MethodInfo |
|
class |
AbstractFinder.PackageInfo |
Modifier and Type | Field | Description |
---|---|---|
protected Map<String,AbstractFinder.ClassInfo> |
classInfos |
|
protected Map<String,AbstractFinder.ClassInfo> |
originalInfos |
Constructor | Description |
---|---|
AbstractFinder() |
Modifier and Type | Method | Description |
---|---|---|
List<Class<?>> |
findAnnotatedClasses(Class<? extends Annotation> annotation) |
|
List<Constructor> |
findAnnotatedConstructors(Class<? extends Annotation> annotation) |
|
List<Field> |
findAnnotatedFields(Class<? extends Annotation> annotation) |
|
List<Method> |
findAnnotatedMethods(Class<? extends Annotation> annotation) |
|
List<Package> |
findAnnotatedPackages(Class<? extends Annotation> annotation) |
|
List<Class<?>> |
findClassesInPackage(String packageName,
boolean recursive) |
|
<T> List<Class<? extends T>> |
findImplementations(Class<T> clazz) |
|
List<Class<?>> |
findInheritedAnnotatedClasses(Class<? extends Annotation> annotation) |
Naive implementation - works extremelly slow O(n^3)
|
List<Annotated<Class<?>>> |
findMetaAnnotatedClasses(Class<? extends Annotation> annotation) |
|
List<Annotated<Field>> |
findMetaAnnotatedFields(Class<? extends Annotation> annotation) |
|
List<Annotated<Method>> |
findMetaAnnotatedMethods(Class<? extends Annotation> annotation) |
|
<T> List<Class<? extends T>> |
findSubclasses(Class<T> clazz) |
|
List<String> |
getAnnotatedClassNames() |
|
protected List<AbstractFinder.Info> |
getAnnotationInfos(String name) |
|
List<String> |
getClassesNotLoaded() |
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) |
|
AbstractFinder |
link() |
The link() method must be called to successfully use the findSubclasses and findImplementations methods
|
protected abstract Class<?> |
loadClass(String fixedName) |
|
protected void |
readClassDef(InputStream in) |
|
protected void |
readClassDef(InputStream in,
String path) |
|
protected void |
readClassDef(Class clazz) |
|
protected void |
readClassDef(String className) |
protected final Map<String,AbstractFinder.ClassInfo> classInfos
protected final Map<String,AbstractFinder.ClassInfo> originalInfos
protected abstract Class<?> loadClass(String fixedName) throws ClassNotFoundException
ClassNotFoundException
public List<String> getAnnotatedClassNames()
getAnnotatedClassNames
in interface IAnnotationFinder
public AbstractFinder link() throws IOException
IOException
public boolean isAnnotationPresent(Class<? extends Annotation> annotation)
isAnnotationPresent
in interface IAnnotationFinder
public List<String> getClassesNotLoaded()
getClassesNotLoaded
in interface IAnnotationFinder
public List<Package> findAnnotatedPackages(Class<? extends Annotation> annotation)
findAnnotatedPackages
in interface IAnnotationFinder
public List<Class<?>> findAnnotatedClasses(Class<? extends Annotation> annotation)
findAnnotatedClasses
in interface IAnnotationFinder
public List<Annotated<Class<?>>> findMetaAnnotatedClasses(Class<? extends Annotation> annotation)
findMetaAnnotatedClasses
in interface IAnnotationFinder
public List<Class<?>> findInheritedAnnotatedClasses(Class<? extends Annotation> annotation)
findInheritedAnnotatedClasses
in interface IAnnotationFinder
annotation
- public List<Method> findAnnotatedMethods(Class<? extends Annotation> annotation)
findAnnotatedMethods
in interface IAnnotationFinder
public List<Annotated<Method>> findMetaAnnotatedMethods(Class<? extends Annotation> annotation)
findMetaAnnotatedMethods
in interface IAnnotationFinder
public List<Constructor> findAnnotatedConstructors(Class<? extends Annotation> annotation)
findAnnotatedConstructors
in interface IAnnotationFinder
public List<Field> findAnnotatedFields(Class<? extends Annotation> annotation)
findAnnotatedFields
in interface IAnnotationFinder
public List<Annotated<Field>> findMetaAnnotatedFields(Class<? extends Annotation> annotation)
findMetaAnnotatedFields
in interface IAnnotationFinder
public List<Class<?>> findClassesInPackage(String packageName, boolean recursive)
findClassesInPackage
in interface IAnnotationFinder
public <T> List<Class<? extends T>> findSubclasses(Class<T> clazz)
findSubclasses
in interface IAnnotationFinder
public <T> List<Class<? extends T>> findImplementations(Class<T> clazz)
findImplementations
in interface IAnnotationFinder
protected List<AbstractFinder.Info> getAnnotationInfos(String name)
protected void readClassDef(String className)
protected void readClassDef(InputStream in) throws IOException
IOException
protected void readClassDef(InputStream in, String path) throws IOException
IOException
protected void readClassDef(Class clazz)
Copyright © 2005–2018. All rights reserved.