org.springframework.boot.context.properties

Class ConfigurationPropertiesBindingPostProcessor

  • java.lang.Object
    • org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor
  • All Implemented Interfaces:
    EventListener, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>, org.springframework.context.EnvironmentAware, org.springframework.core.Ordered, org.springframework.core.PriorityOrdered


    public class ConfigurationPropertiesBindingPostProcessor
    extends Object
    implements org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.beans.factory.BeanFactoryAware, org.springframework.context.EnvironmentAware, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>, org.springframework.core.PriorityOrdered
    BeanPostProcessor to bind PropertySources to beans annotated with ConfigurationProperties.
    Author:
    Dave Syer, Phillip Webb, Christian Dupuis, Stephane Nicoll
    • Field Detail

      • VALIDATOR_BEAN_NAME

        public static final String VALIDATOR_BEAN_NAME
        The bean name of the configuration properties validator.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ConfigurationPropertiesBindingPostProcessor

        public ConfigurationPropertiesBindingPostProcessor()
    • Method Detail

      • setConverters

        @Autowired(required=false)
         @ConfigurationPropertiesBinding
        public void setConverters(List<org.springframework.core.convert.converter.Converter<?,?>> converters)
        A list of custom converters (in addition to the defaults) to use when converting properties for binding.
        Parameters:
        converters - the converters to set
      • setGenericConverters

        @Autowired(required=false)
         @ConfigurationPropertiesBinding
        public void setGenericConverters(List<org.springframework.core.convert.converter.GenericConverter> converters)
        A list of custom converters (in addition to the defaults) to use when converting properties for binding.
        Parameters:
        converters - the converters to set
      • setOrder

        public void setOrder(int order)
        Set the order of the bean.
        Parameters:
        order - the order
      • getOrder

        public int getOrder()
        Return the order of the bean.
        Specified by:
        getOrder in interface org.springframework.core.Ordered
        Returns:
        the order
      • setPropertySources

        public void setPropertySources(org.springframework.core.env.PropertySources propertySources)
        Set the property sources to bind.
        Parameters:
        propertySources - the property sources
      • setValidator

        public void setValidator(org.springframework.validation.Validator validator)
        Set the bean validator used to validate property fields.
        Parameters:
        validator - the validator
      • setConversionService

        public void setConversionService(org.springframework.core.convert.ConversionService conversionService)
        Set the conversion service used to convert property values.
        Parameters:
        conversionService - the conversion service
      • setBeanMetaDataStore

        public void setBeanMetaDataStore(ConfigurationBeanFactoryMetaData beans)
        Set the bean meta-data store.
        Parameters:
        beans - the bean meta data store
      • setBeanFactory

        public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
                            throws org.springframework.beans.BeansException
        Specified by:
        setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
        Throws:
        org.springframework.beans.BeansException
      • setEnvironment

        public void setEnvironment(org.springframework.core.env.Environment environment)
        Specified by:
        setEnvironment in interface org.springframework.context.EnvironmentAware
      • setApplicationContext

        public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        Exception
      • onApplicationEvent

        public void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
        Specified by:
        onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
      • destroy

        public void destroy()
                     throws Exception
        Specified by:
        destroy in interface org.springframework.beans.factory.DisposableBean
        Throws:
        Exception
      • postProcessBeforeInitialization

        public Object postProcessBeforeInitialization(Object bean,
                                                      String beanName)
                                               throws org.springframework.beans.BeansException
        Specified by:
        postProcessBeforeInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor
        Throws:
        org.springframework.beans.BeansException
      • postProcessAfterInitialization

        public Object postProcessAfterInitialization(Object bean,
                                                     String beanName)
                                              throws org.springframework.beans.BeansException
        Specified by:
        postProcessAfterInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor
        Throws:
        org.springframework.beans.BeansException

Copyright © 2018 Pivotal Software, Inc.. All rights reserved.