org.apache.xbean.finder
Class AbstractFinder
java.lang.Object
org.apache.xbean.finder.AbstractFinder
- Direct Known Subclasses:
- BundleAnnotationFinder, ClassFinder
public abstract class AbstractFinder
- extends Object
- Version:
- $Rev: 924423 $ $Date: 2010-03-17 15:06:14 -0400 (Wed, 17 Mar 2010) $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
classInfos
protected final List<AbstractFinder.ClassInfo> classInfos
AbstractFinder
public AbstractFinder()
getResource
protected abstract URL getResource(String className)
loadClass
protected abstract Class<?> loadClass(String fixedName)
throws ClassNotFoundException
- Throws:
ClassNotFoundException
isAnnotationPresent
public boolean isAnnotationPresent(Class<? extends Annotation> annotation)
getClassesNotLoaded
public List<String> 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.
- Returns:
- an unmodifiable live view of classes that could not be loaded in previous findAnnotated* call.
findAnnotatedPackages
public List<Package> findAnnotatedPackages(Class<? extends Annotation> annotation)
findAnnotatedClasses
public List<Class> findAnnotatedClasses(Class<? extends Annotation> annotation)
findInheritedAnnotatedClasses
public List<Class> findInheritedAnnotatedClasses(Class<? extends Annotation> annotation)
- Naive implementation - works extremelly slow O(n^3)
- Parameters:
annotation
-
- Returns:
- list of directly or indirectly (inherited) annotated classes
findAnnotatedMethods
public List<Method> findAnnotatedMethods(Class<? extends Annotation> annotation)
findAnnotatedConstructors
public List<Constructor> findAnnotatedConstructors(Class<? extends Annotation> annotation)
findAnnotatedFields
public List<Field> findAnnotatedFields(Class<? extends Annotation> annotation)
findClassesInPackage
public List<Class> findClassesInPackage(String packageName,
boolean recursive)
getAnnotationInfos
protected List<AbstractFinder.Info> getAnnotationInfos(String name)
readClassDef
protected void readClassDef(InputStream in)
throws IOException
- Throws:
IOException
Copyright © 2005-2011. All Rights Reserved.