类 CodeDreamPropertySourcePostProcessor

  • 所有已实现的接口:
    org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered

    @Component
    public class CodeDreamPropertySourcePostProcessor
    extends Object
    implements org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered
    实现该接口BeanFactoryPostProcessor,可以在spring的bean创建之前,修改bean的定义属性。 也就是说,Spring允许BeanFactoryPostProcessor在容器实例化任何其它bean之前读取配置元数据,并可以根据需要进行修改, 例如可以把bean的scope从singleton改为prototype,也可以把property的值给修改掉。 可以同时配置多个BeanFactoryPostProcessor,并通过设置'order'属性来控制各个BeanFactoryPostProcessor的执行次序。

    自定义资源文件读取,优先级最低

    • 构造器详细资料

      • CodeDreamPropertySourcePostProcessor

        public CodeDreamPropertySourcePostProcessor()
    • 方法详细资料

      • postProcessBeanFactory

        public void postProcessBeanFactory​(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
                                    throws org.springframework.beans.BeansException
        指定者:
        postProcessBeanFactory 在接口中 org.springframework.beans.factory.config.BeanFactoryPostProcessor
        抛出:
        org.springframework.beans.BeansException
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception
        指定者:
        afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBean
        抛出:
        Exception
      • getOrder

        public int getOrder()
        指定者:
        getOrder 在接口中 org.springframework.core.Ordered