public class

PropertySourcesPlaceholderConfigurer

extends PlaceholderConfigurerSupport
implements EnvironmentAware
java.lang.Object
   ↳ org.springframework.core.io.support.PropertiesLoaderSupport
     ↳ org.springframework.beans.factory.config.PropertyResourceConfigurer
       ↳ org.springframework.beans.factory.config.PlaceholderConfigurerSupport
         ↳ org.springframework.context.support.PropertySourcesPlaceholderConfigurer

Class Overview

Specialization of PlaceholderConfigurerSupport

Local properties are added as a property source in any case. Precedence is based on the value of the localOverride property.

Summary

Constants
String ENVIRONMENT_PROPERTIES_PROPERTY_SOURCE_NAME {@value } is the name given to the PropertySource that wraps the environment supplied to this configurer.
String LOCAL_PROPERTIES_PROPERTY_SOURCE_NAME {@value } is the name given to the PropertySource for the set of merged properties supplied to this configurer.
[Expand]
Inherited Constants
From class org.springframework.beans.factory.config.PlaceholderConfigurerSupport
From class org.springframework.core.io.support.PropertiesLoaderSupport
From interface org.springframework.core.Ordered
[Expand]
Inherited Fields
From class org.springframework.beans.factory.config.PlaceholderConfigurerSupport
From class org.springframework.core.io.support.PropertiesLoaderSupport
Public Constructors
PropertySourcesPlaceholderConfigurer()
Public Methods
void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
Merge, convert and process properties against the given bean factory.

Processing occurs by replacing ${...} placeholders in bean definitions by resolving each against this configurer's set of PropertySources, which includes:

If setPropertySources(PropertySources) is called, environment and local properties will be ignored.

void setEnvironment(Environment environment)
Set the Environment that this object runs in.

PropertySources from this environment will be searched when replacing ${...} placeholders.

void setPropertySources(PropertySources propertySources)
Customize the set of PropertySources to be used by this configurer.
Protected Methods
void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess, ConfigurablePropertyResolver propertyResolver)
Visit each bean definition in the given bean factory and attempt to replace ${...} property placeholders with values from the given properties.
void processProperties(ConfigurableListableBeanFactory beanFactory, Properties props)
[Expand]
Inherited Methods
From class org.springframework.beans.factory.config.PlaceholderConfigurerSupport
From class org.springframework.beans.factory.config.PropertyResourceConfigurer
From class org.springframework.core.io.support.PropertiesLoaderSupport
From class java.lang.Object
From interface org.springframework.beans.factory.BeanFactoryAware
From interface org.springframework.beans.factory.BeanNameAware
From interface org.springframework.beans.factory.config.BeanFactoryPostProcessor
From interface org.springframework.context.EnvironmentAware
From interface org.springframework.core.Ordered

Constants

public static final String ENVIRONMENT_PROPERTIES_PROPERTY_SOURCE_NAME

{@value } is the name given to the PropertySource that wraps the environment supplied to this configurer.

Constant Value: "environmentProperties"

public static final String LOCAL_PROPERTIES_PROPERTY_SOURCE_NAME

{@value } is the name given to the PropertySource for the set of merged properties supplied to this configurer.

Constant Value: "localProperties"

Public Constructors

public PropertySourcesPlaceholderConfigurer ()

Public Methods

public void postProcessBeanFactory (ConfigurableListableBeanFactory beanFactory)

Merge, convert and process properties against the given bean factory.

Processing occurs by replacing ${...} placeholders in bean definitions by resolving each against this configurer's set of PropertySources, which includes:

If setPropertySources(PropertySources) is called, environment and local properties will be ignored. This method is designed to give the user fine-grained control over property sources, and once set, the configurer makes no assumptions about adding additional sources.

Parameters
beanFactory the bean factory used by the application context

public void setEnvironment (Environment environment)

Set the Environment that this object runs in.

PropertySources from this environment will be searched when replacing ${...} placeholders.

public void setPropertySources (PropertySources propertySources)

Customize the set of PropertySources to be used by this configurer. Setting this property indicates that environment property sources and local properties should be ignored.

Protected Methods

protected void processProperties (ConfigurableListableBeanFactory beanFactoryToProcess, ConfigurablePropertyResolver propertyResolver)

Visit each bean definition in the given bean factory and attempt to replace ${...} property placeholders with values from the given properties.

protected void processProperties (ConfigurableListableBeanFactory beanFactory, Properties props)

This method is deprecated.
in favor of processProperties(ConfigurableListableBeanFactory, ConfigurablePropertyResolver)

Implemented for compatibility with PlaceholderConfigurerSupport.

Parameters
beanFactory the BeanFactory used by the application context
props the Properties to apply