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
Field Summary
Fields Modifier and Type Field Description static String
VALIDATOR_BEAN_NAME
The bean name of the configuration properties validator.
Constructor Summary
Constructors Constructor Description ConfigurationPropertiesBindingPostProcessor()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
void
destroy()
int
getOrder()
Return the order of the bean.void
onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
Object
postProcessAfterInitialization(Object bean, String beanName)
Object
postProcessBeforeInitialization(Object bean, String beanName)
void
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
void
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
void
setBeanMetaDataStore(ConfigurationBeanFactoryMetaData beans)
Set the bean meta-data store.void
setConversionService(org.springframework.core.convert.ConversionService conversionService)
Set the conversion service used to convert property values.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.void
setEnvironment(org.springframework.core.env.Environment environment)
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.void
setOrder(int order)
Set the order of the bean.void
setPropertySources(org.springframework.core.env.PropertySources propertySources)
Set the property sources to bind.void
setValidator(org.springframework.validation.Validator validator)
Set the bean validator used to validate property fields.
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 interfaceorg.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 interfaceorg.springframework.beans.factory.BeanFactoryAware
- Throws:
org.springframework.beans.BeansException
setEnvironment
public void setEnvironment(org.springframework.core.env.Environment environment)
- Specified by:
setEnvironment
in interfaceorg.springframework.context.EnvironmentAware
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
- Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
afterPropertiesSet
public void afterPropertiesSet() throws Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
onApplicationEvent
public void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
- Specified by:
onApplicationEvent
in interfaceorg.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
destroy
public void destroy() throws Exception
- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Throws:
Exception
postProcessBeforeInitialization
public Object postProcessBeforeInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException
- Specified by:
postProcessBeforeInitialization
in interfaceorg.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 interfaceorg.springframework.beans.factory.config.BeanPostProcessor
- Throws:
org.springframework.beans.BeansException