接口 BeanFactoryPostProcessor
- 所有已知实现类:
AspectJWeavingEnabler
,ConfigurationClassPostProcessor
,CustomAutowireConfigurer
,CustomEditorConfigurer
,CustomScopeConfigurer
,DeprecatedBeanWarner
,PlaceholderConfigurerSupport
,PreferencesPlaceholderConfigurer
,PropertyOverrideConfigurer
,PropertyPlaceholderConfigurer
,PropertyResourceConfigurer
,PropertySourcesPlaceholderConfigurer
public interface BeanFactoryPostProcessor
Allows for custom modification of an application context's bean definitions, adapting the bean property values of the context's underlying bean factory.Application contexts can auto-detect BeanFactoryPostProcessor beans in their bean definitions and apply them before any other beans get created.
Useful for custom config files targeted at system administrators that override bean properties configured in the application context.
See PropertyResourceConfigurer and its concrete implementations for out-of-the-box solutions that address such configuration needs.
A BeanFactoryPostProcessor may interact with and modify bean definitions, but never bean instances. Doing so may cause premature bean instantiation, violating the container and causing unintended side-effects. If bean instance interaction is required, consider implementing
BeanPostProcessor
instead.- 从以下版本开始:
- 06.07.2003
- 作者:
- Juergen Hoeller
- 另请参阅:
BeanPostProcessor
,PropertyResourceConfigurer
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 void
postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
Modify the application context's internal bean factory after its standard initialization.
方法详细资料
postProcessBeanFactory
void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException
Modify the application context's internal bean factory after its standard initialization. All bean definitions will have been loaded, but no beans will have been instantiated yet. This allows for overriding or adding properties even to eager-initializing beans.- 参数:
beanFactory
- the bean factory used by the application context- 抛出:
BeansException
- in case of errors