|
spring-context | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.context.annotation.ConfigurationClassPostProcessor
public class ConfigurationClassPostProcessor
BeanFactoryPostProcessor
used for bootstrapping processing of
@Configuration
classes.
Registered by default when using <context:annotation-config/>
or
<context:component-scan/>
. Otherwise, may be declared manually as
with any other BeanFactoryPostProcessor.
This post processor is Ordered.HIGHEST_PRECEDENCE
as it is important
that any Bean
methods declared in Configuration classes have their
respective bean definitions registered before any other BeanFactoryPostProcessor
executes.
Constructor Summary | |
---|---|
ConfigurationClassPostProcessor()
|
Method Summary | |
---|---|
void |
enhanceConfigurationClasses(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
Post-processes a BeanFactory in search of Configuration class BeanDefinitions; any candidates are then enhanced by a ConfigurationClassEnhancer . |
void |
postProcessBeanDefinitionRegistry(org.springframework.beans.factory.support.BeanDefinitionRegistry registry)
Derive further bean definitions from the configuration classes in the registry. |
void |
postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
Prepare the Configuration classes for servicing bean requests at runtime by replacing them with CGLIB-enhanced subclasses. |
void |
processConfigBeanDefinitions(org.springframework.beans.factory.support.BeanDefinitionRegistry registry)
Build and validate a configuration model based on the registry of Configuration classes. |
void |
setBeanClassLoader(java.lang.ClassLoader beanClassLoader)
|
void |
setBeanNameGenerator(org.springframework.beans.factory.support.BeanNameGenerator beanNameGenerator)
Set the BeanNameGenerator to be used when registering imported and nested
Configuration classes. |
void |
setEnvironment(org.springframework.core.env.Environment environment)
Set the Environment that this object runs in. |
void |
setMetadataReaderFactory(org.springframework.core.type.classreading.MetadataReaderFactory metadataReaderFactory)
Set the MetadataReaderFactory to use. |
void |
setProblemReporter(org.springframework.beans.factory.parsing.ProblemReporter problemReporter)
Set the ProblemReporter to use. |
void |
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
Set the ResourceLoader that this object runs in. |
void |
setSourceExtractor(org.springframework.beans.factory.parsing.SourceExtractor sourceExtractor)
Set the SourceExtractor to use for generated bean definitions
that correspond to Bean factory methods. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConfigurationClassPostProcessor()
Method Detail |
---|
public void setSourceExtractor(org.springframework.beans.factory.parsing.SourceExtractor sourceExtractor)
SourceExtractor
to use for generated bean definitions
that correspond to Bean
factory methods.
public void setProblemReporter(org.springframework.beans.factory.parsing.ProblemReporter problemReporter)
ProblemReporter
to use.
Used to register any problems detected with Configuration
or Bean
declarations. For instance, an @Bean method marked as final
is illegal
and would be reported as a problem. Defaults to FailFastProblemReporter
.
public void setMetadataReaderFactory(org.springframework.core.type.classreading.MetadataReaderFactory metadataReaderFactory)
MetadataReaderFactory
to use.
Default is a CachingMetadataReaderFactory
for the specified
bean class loader.
public void setBeanNameGenerator(org.springframework.beans.factory.support.BeanNameGenerator beanNameGenerator)
BeanNameGenerator
to be used when registering imported and nested
Configuration
classes. The default is AnnotationBeanNameGenerator
.
Note that this strategy does not apply to Bean
methods.
This setter is typically only appropriate when configuring the post-processor as
a standalone bean definition in XML, e.g. not using the dedicated
AnnotationConfig*
application contexts or the <context:annotation-config>
element. Any bean name generator specified against
the application context will take precedence over any value set here.
beanNameGenerator
- the strategy to use when generating configuration class
bean namesAnnotationConfigApplicationContext.setBeanNameGenerator(BeanNameGenerator)
,
AnnotationConfigUtils.CONFIGURATION_BEAN_NAME_GENERATOR
public void setEnvironment(org.springframework.core.env.Environment environment)
EnvironmentAware
Environment
that this object runs in.
setEnvironment
in interface EnvironmentAware
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
ResourceLoaderAware
This might be a ResourcePatternResolver, which can be checked
through instanceof ResourcePatternResolver
. See also the
ResourcePatternUtils.getResourcePatternResolver
method.
Invoked after population of normal bean properties but before an init callback
like InitializingBean's afterPropertiesSet
or a custom init-method.
Invoked before ApplicationContextAware's setApplicationContext
.
setResourceLoader
in interface ResourceLoaderAware
resourceLoader
- ResourceLoader object to be used by this objectResourcePatternResolver
,
ResourcePatternUtils.getResourcePatternResolver(org.springframework.core.io.ResourceLoader)
public void setBeanClassLoader(java.lang.ClassLoader beanClassLoader)
setBeanClassLoader
in interface org.springframework.beans.factory.BeanClassLoaderAware
public void postProcessBeanDefinitionRegistry(org.springframework.beans.factory.support.BeanDefinitionRegistry registry)
postProcessBeanDefinitionRegistry
in interface org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
postProcessBeanFactory
in interface org.springframework.beans.factory.config.BeanFactoryPostProcessor
public void processConfigBeanDefinitions(org.springframework.beans.factory.support.BeanDefinitionRegistry registry)
Configuration
classes.
public void enhanceConfigurationClasses(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
ConfigurationClassEnhancer
.
Candidate status is determined by BeanDefinition attribute metadata.
ConfigurationClassEnhancer
|
spring-context | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |