|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.context.annotation.ClassPathBeanDefinitionScanner
public class ClassPathBeanDefinitionScanner
A BeanDefinitionScanner
that detects bean candidates on the classpath.
Constructor Summary | |
---|---|
ClassPathBeanDefinitionScanner(BeanDefinitionRegistry registry)
Create a new ClassPathBeanDefinitionScanner for the given bean factory. |
Method Summary | |
---|---|
int |
scan(String basePackage)
Perform a scan within the specified base package. |
int |
scan(String[] basePackages)
Perform a scan within the specified base packages. |
int |
scan(String[] basePackages,
boolean useDefaultFilters,
List<TypeFilter> excludeFilters,
List<TypeFilter> includeFilters)
Perform a scan within the specified base packages. |
int |
scan(String basePackage,
boolean useDefaultFilters,
List<TypeFilter> excludeFilters,
List<TypeFilter> includeFilters)
Perform a scan within the specified base package. |
void |
setBeanNameGenerator(BeanNameGenerator beanNameGenerator)
Set the BeanNameGenerator to use for detected bean classes. |
void |
setIncludeAnnotationConfig(boolean includeAnnotationConfig)
Specify whether to register annotation config post-processors. |
void |
setResourceLoader(ResourceLoader resourceLoader)
Set the ResourceLoader to use for resource locations. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassPathBeanDefinitionScanner(BeanDefinitionRegistry registry)
If the passed-in bean factory does not only implement the BeanDefinitionRegistry
interface but also the ResourceLoader interface, it will be used as default
ResourceLoader as well. This will usually be the case for
ApplicationContext
implementations.
If given a plain BeanDefinitionRegistry, the default ResourceLoader will be a
PathMatchingResourcePatternResolver
.
registry
- the BeanFactory to load bean definitions into,
in the form of a BeanDefinitionRegistrysetResourceLoader(org.springframework.core.io.ResourceLoader)
Method Detail |
---|
public void setResourceLoader(ResourceLoader resourceLoader)
Default is PathMatchingResourcePatternResolver, also capable of resource pattern resolving through the ResourcePatternResolver interface.
setResourceLoader
in interface ResourceLoaderAware
resourceLoader
- ResourceLoader object to be used by this objectResourcePatternResolver
,
PathMatchingResourcePatternResolver
public void setBeanNameGenerator(BeanNameGenerator beanNameGenerator)
Default is a ComponentBeanNameGenerator
.
public void setIncludeAnnotationConfig(boolean includeAnnotationConfig)
The default is to register the post-processors. Turn this off to be able to ignore the annotations or to process them differently.
public int scan(String basePackage)
scan
in interface BeanDefinitionScanner
basePackage
- the package to check for annotated classes
public int scan(String[] basePackages)
scan
in interface BeanDefinitionScanner
basePackages
- the packages to check for annotated classes
public int scan(String basePackage, boolean useDefaultFilters, List<TypeFilter> excludeFilters, List<TypeFilter> includeFilters)
basePackage
- the package to check for annotated classes
public int scan(String[] basePackages, boolean useDefaultFilters, List<TypeFilter> excludeFilters, List<TypeFilter> includeFilters)
basePackages
- the packages to check for annotated classes
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |