|
||||||||||
| 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.slf4j.Logger |
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 URL |
customResourceLocator(URL url)
|
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)
Attempts 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. |
boolean |
isAcceptableScheme(String urlPath)
|
void |
removeFilter(PackageScanFilter filter)
Removes the filter |
void |
setAcceptableSchemes(String schemes)
|
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.slf4j.Logger log
| Constructor Detail |
|---|
public DefaultPackageScanClassResolver()
| Method Detail |
|---|
public void addClassLoader(ClassLoader classLoader)
PackageScanClassResolver
addClassLoader in interface PackageScanClassResolverclassLoader - the loader to addpublic void addFilter(PackageScanFilter filter)
PackageScanClassResolver
addFilter in interface PackageScanClassResolverfilter - filter to filter desired classes in all scan operationspublic void removeFilter(PackageScanFilter filter)
PackageScanClassResolver
removeFilter in interface PackageScanClassResolverfilter - filter to filter desired classes in all scan operationspublic void setAcceptableSchemes(String schemes)
public boolean isAcceptableScheme(String urlPath)
public Set<ClassLoader> getClassLoaders()
PackageScanClassResolverPackageScanClassResolver.addClassLoader(ClassLoader) method if you want to add new classloaders
to the class loaders list.
getClassLoaders in interface PackageScanClassResolverpublic void setClassLoaders(Set<ClassLoader> classLoaders)
PackageScanClassResolver
setClassLoaders in interface PackageScanClassResolverclassLoaders - loaders to use when scanning for classes
public Set<Class<?>> findAnnotated(Class<? extends Annotation> annotation,
String... packageNames)
PackageScanClassResolver
findAnnotated in interface PackageScanClassResolverannotation - 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 PackageScanClassResolverannotations - 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 PackageScanClassResolverparent - 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 PackageScanClassResolverfilter - 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 URL customResourceLocator(URL url)
throws IOException
IOException
protected Enumeration<URL> getResources(ClassLoader loader,
String packageName)
throws IOException
WebSpherePackageScanClassResolver
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 classloader
protected 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 | |||||||||