Class PropertySourcesPlaceholderConfigurer

All Implemented Interfaces:
Aware, BeanFactoryAware, BeanNameAware, BeanFactoryPostProcessor, EnvironmentAware, Ordered, PriorityOrdered

public class PropertySourcesPlaceholderConfigurer extends PlaceholderConfigurerSupport implements EnvironmentAware
Specialization of PlaceholderConfigurerSupport that resolves ${...} placeholders within bean definition property values and @Value annotations against the current Spring Environment and its set of PropertySources.

This class is designed as a general replacement for PropertyPlaceholderConfigurer. It is used by default to support the property-placeholder element in working against the spring-context-3.1 or higher XSD; whereas, spring-context versions <= 3.0 default to PropertyPlaceholderConfigurer to ensure backward compatibility. See the spring-context XSD documentation for complete details.

Any local properties (e.g. those added via PropertiesLoaderSupport.setProperties(java.util.Properties), PropertiesLoaderSupport.setLocations(org.springframework.core.io.Resource...) et al.) are added as a PropertySource. Search precedence of local properties is based on the value of the localOverride property, which is by default false meaning that local properties are to be searched last, after all environment property sources.

See ConfigurableEnvironment and related javadocs for details on manipulating environment property sources.

Since:
3.1
Author:
Chris Beams, Juergen Hoeller, Sam Brannen
See Also: