java.lang.Object | ||
↳ | org.springframework.core.io.support.PropertiesLoaderSupport | |
↳ | org.springframework.beans.factory.config.PropertyResourceConfigurer |
Known Direct Subclasses |
Known Indirect Subclasses |
Allows for configuration of individual bean property values from a property resource, i.e. a properties file. Useful for custom config files targeted at system administrators that override bean properties configured in the application context.
Two concrete implementations are provided in the distribution:
PropertyOverrideConfigurer
for "beanName.property=value" style overriding
(pushing values from a properties file into bean definitions)
PropertyPlaceholderConfigurer
for replacing "${...}" placeholders
(pulling values from a properties file into bean definitions)
Property values can be converted after reading them in, through overriding
the convertPropertyValue(String)
method. For example, encrypted values
can be detected and decrypted accordingly before processing them.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.core.io.support.PropertiesLoaderSupport
| |||||||||||
From interface
org.springframework.core.Ordered
|
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.core.io.support.PropertiesLoaderSupport
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return the order value of this object, with a
higher value meaning greater in terms of sorting.
| |||||||||||
Set the order value of this object for sorting purposes.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Convert the given merged properties, converting property values
if necessary.
| |||||||||||
Convert the given property from the properties source to the value
which should be applied.
| |||||||||||
Convert the given property value from the properties source to the value
which should be applied.
| |||||||||||
Apply the given Properties to the given BeanFactory.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.core.io.support.PropertiesLoaderSupport
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.beans.factory.config.BeanFactoryPostProcessor
| |||||||||||
From interface
org.springframework.core.Ordered
|
Return the order value of this object, with a higher value meaning greater in terms of sorting.
Normally starting with 0, with Integer.MAX_VALUE
indicating the greatest value. Same order values will result
in arbitrary positions for the affected objects.
Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).
beanFactory | the bean factory used by the application context |
---|
BeanInitializationException | if any properties cannot be loaded |
---|---|
BeansException |
Set the order value of this object for sorting purposes.
Convert the given merged properties, converting property values if necessary. The result will then be processed.
The default implementation will invoke convertPropertyValue(String)
for each property value, replacing the original with the converted value.
props | the Properties to convert |
---|
Convert the given property from the properties source to the value which should be applied.
The default implementation calls convertPropertyValue(String)
.
propertyName | the name of the property that the value is defined for |
---|---|
propertyValue | the original value from the properties source |
Convert the given property value from the properties source to the value which should be applied.
The default implementation simply returns the original value. Can be overridden in subclasses, for example to detect encrypted values and decrypt them accordingly.
originalValue | the original value from the properties source (properties file or local "properties") |
---|
Apply the given Properties to the given BeanFactory.
beanFactory | the BeanFactory used by the application context |
---|---|
props | the Properties to apply |
BeansException | in case of errors |
---|