public class AnnotationFinder extends Object implements IAnnotationFinder
Modifier and Type | Class and Description |
---|---|
class |
AnnotationFinder.Annotatable |
class |
AnnotationFinder.AnnotationInfo |
class |
AnnotationFinder.ClassInfo |
class |
AnnotationFinder.FieldInfo |
static class |
AnnotationFinder.GenericAwareInfoBuildingVisitor |
static interface |
AnnotationFinder.Info |
class |
AnnotationFinder.InfoBuildingVisitor |
class |
AnnotationFinder.MethodInfo |
class |
AnnotationFinder.PackageInfo |
Modifier and Type | Field and Description |
---|---|
protected Map<String,AnnotationFinder.ClassInfo> |
classInfos |
protected Map<String,AnnotationFinder.ClassInfo> |
originalInfos |
Constructor and Description |
---|
AnnotationFinder(Archive archive) |
Modifier and Type | Method and 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<AnnotationFinder.Info> |
getAnnotationInfos(String name) |
Archive |
getArchive() |
List<String> |
getClassesNotLoaded()
Returns a list of classes that could not be loaded in last invoked findAnnotated* method.
|
boolean |
isAnnotationPresent(Class<? extends Annotation> annotation) |
AnnotationFinder |
link()
The link() method must be called to successfully use the findSubclasses and findImplementations methods
|
protected void |
readClassDef(Class clazz) |
protected void |
readClassDef(InputStream in) |
protected void |
readClassDef(String className) |
protected final Map<String,AnnotationFinder.ClassInfo> classInfos
protected final Map<String,AnnotationFinder.ClassInfo> originalInfos
public AnnotationFinder(Archive archive)
public List<String> getAnnotatedClassNames()
getAnnotatedClassNames
in interface IAnnotationFinder
public Archive getArchive()
public AnnotationFinder link()
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<Annotated<Field>> findMetaAnnotatedFields(Class<? extends Annotation> annotation)
findMetaAnnotatedFields
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<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<AnnotationFinder.Info> getAnnotationInfos(String name)
protected void readClassDef(String className)
protected void readClassDef(InputStream in) throws IOException
IOException
protected void readClassDef(Class clazz)
Copyright © 2005-2012. All Rights Reserved.