public class CorePackageScanClassResolver extends Object implements PackageScanClassResolver
ClassResolver which loads type converters
from a hardcoded list of classes.
Important: Whenever a new type converter class is added to camel-core
then the class should be added to the list in this class.CoreTypeConverterLoader| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
log |
| Constructor and Description |
|---|
CorePackageScanClassResolver() |
| Modifier and Type | Method and Description |
|---|---|
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
|
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.
|
void |
removeFilter(PackageScanFilter filter)
Removes the filter
|
void |
setClassLoaders(Set<ClassLoader> classLoaders)
Sets the ClassLoader instances that should be used when scanning for
classes.
|
protected final org.slf4j.Logger log
public CorePackageScanClassResolver()
public void setClassLoaders(Set<ClassLoader> classLoaders)
PackageScanClassResolversetClassLoaders in interface PackageScanClassResolverclassLoaders - loaders to use when scanning for classespublic Set<ClassLoader> getClassLoaders()
PackageScanClassResolverPackageScanClassResolver.addClassLoader(ClassLoader) method if you want to add new classloaders
to the class loaders list.getClassLoaders in interface PackageScanClassResolverpublic void addClassLoader(ClassLoader classLoader)
PackageScanClassResolveraddClassLoader in interface PackageScanClassResolverclassLoader - the loader to addpublic Set<Class<?>> findAnnotated(Class<? extends Annotation> annotation, String... packageNames)
PackageScanClassResolverfindAnnotated in interface PackageScanClassResolverannotation - the annotation that should be present on matching classespackageNames - one or more package names to scan (including subpackages) for classespublic Set<Class<?>> findAnnotated(Set<Class<? extends Annotation>> annotations, String... packageNames)
PackageScanClassResolverfindAnnotated 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 classespublic Set<Class<?>> findImplementations(Class<?> parent, String... packageNames)
PackageScanClassResolverfindImplementations in interface PackageScanClassResolverparent - the class of interface to find subclasses or implementations ofpackageNames - one or more package names to scan (including subpackages) for classespublic Set<Class<?>> findByFilter(PackageScanFilter filter, String... packageNames)
PackageScanClassResolverfindByFilter in interface PackageScanClassResolverfilter - filter to filter desired classes.packageNames - one or more package names to scan (including subpackages) for classespublic void addFilter(PackageScanFilter filter)
PackageScanClassResolveraddFilter in interface PackageScanClassResolverfilter - filter to filter desired classes in all scan operationspublic void removeFilter(PackageScanFilter filter)
PackageScanClassResolverremoveFilter in interface PackageScanClassResolverfilter - filter to filter desired classes in all scan operationsApache Camel