|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.camel.impl.DefaultPackageScanClassResolver
public class DefaultPackageScanClassResolver
Default implement of PackageScanClassResolver
Field Summary | |
---|---|
protected org.apache.commons.logging.Log |
log
|
Constructor Summary | |
---|---|
DefaultPackageScanClassResolver()
|
Method Summary | |
---|---|
void |
addClassLoader(ClassLoader classLoader)
Adds the class loader to the existing loaders |
void |
addFilter(PackageScanFilter filter)
Add a filter that will be applied to all scan operations |
protected void |
addIfMatching(PackageScanFilter test,
String fqn,
Set<Class> classes)
Add the class designated by the fully qualified class name provided to the set of resolved classes if and only if it is approved by the Test supplied. |
protected void |
find(PackageScanFilter test,
String packageName,
ClassLoader loader,
Set<Class> classes)
|
protected void |
find(PackageScanFilter test,
String packageName,
Set<Class> classes)
|
Set<Class> |
findAnnotated(Class<? extends Annotation> annotation,
String... packageNames)
Attempts to discover classes that are annotated with to the annotation. |
Set<Class> |
findAnnotated(Set<Class<? extends Annotation>> annotations,
String... packageNames)
Attempts to discover classes that are annotated with to the annotation. |
Set<Class> |
findByFilter(PackageScanFilter filter,
String... packageNames)
Attemsp to discover classes filter by the provided filter |
Set<Class> |
findImplementations(Class parent,
String... packageNames)
Attempts to discover classes that are assignable to the type provided. |
Set<ClassLoader> |
getClassLoaders()
Gets the ClassLoader instances that should be used when scanning for classes. |
protected Enumeration<URL> |
getResources(ClassLoader loader,
String packageName)
Strategy to get the resources by the given classloader. |
void |
setClassLoaders(Set<ClassLoader> classLoaders)
Sets the ClassLoader instances that should be used when scanning for classes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final transient org.apache.commons.logging.Log log
Constructor Detail |
---|
public DefaultPackageScanClassResolver()
Method Detail |
---|
public void addClassLoader(ClassLoader classLoader)
PackageScanClassResolver
addClassLoader
in interface PackageScanClassResolver
classLoader
- the loader to addpublic void addFilter(PackageScanFilter filter)
PackageScanClassResolver
addFilter
in interface PackageScanClassResolver
filter
- filter to filter desired classes in all scan operationspublic Set<ClassLoader> getClassLoaders()
PackageScanClassResolver
getClassLoaders
in interface PackageScanClassResolver
public void setClassLoaders(Set<ClassLoader> classLoaders)
PackageScanClassResolver
setClassLoaders
in interface PackageScanClassResolver
classLoaders
- loaders to use when scanning for classespublic Set<Class> findAnnotated(Class<? extends Annotation> annotation, String... packageNames)
PackageScanClassResolver
findAnnotated
in interface PackageScanClassResolver
annotation
- the annotation that should be present on matching classespackageNames
- one or more package names to scan (including subpackages) for classes
public Set<Class> findAnnotated(Set<Class<? extends Annotation>> annotations, String... packageNames)
PackageScanClassResolver
findAnnotated
in interface PackageScanClassResolver
annotations
- the annotations that should be present (any of them) on matching classespackageNames
- one or more package names to scan (including subpackages) for classes
public Set<Class> findImplementations(Class parent, String... packageNames)
PackageScanClassResolver
findImplementations
in interface PackageScanClassResolver
parent
- the class of interface to find subclasses or implementations ofpackageNames
- one or more package names to scan (including subpackages) for classes
public Set<Class> findByFilter(PackageScanFilter filter, String... packageNames)
PackageScanClassResolver
findByFilter
in interface PackageScanClassResolver
filter
- filter to filter desired classes.packageNames
- one or more package names to scan (including subpackages) for classes
protected void find(PackageScanFilter test, String packageName, Set<Class> classes)
protected void find(PackageScanFilter test, String packageName, ClassLoader loader, Set<Class> classes)
protected Enumeration<URL> getResources(ClassLoader loader, String packageName) throws IOException
WebSpherePacakageScanClassResolver
to take care of WebSphere's odditiy of resource loading.
loader
- the classloaderpackageName
- the packagename for the package to load
IOException
- is thrown by the classloaderprotected void addIfMatching(PackageScanFilter test, String fqn, Set<Class> classes)
test
- the test used to determine if the class matchesfqn
- the fully qualified name of a class
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |