java.lang.Object | |
↳ | org.springframework.core.env.MutablePropertySources |
Default implementation of the PropertySources
interface.
Allows manipulation of contained property sources and provides constructor
to copying an existing PropertySources
instance.
Where precedence is mentioned in methods such as addFirst(PropertySource>)
and addLast(PropertySource>)
, this is with regard to the order in which property sources
will be searched when resolving a given property with a PropertyResolver
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new
MutablePropertySources object. | |||||||||||
Create a new
MutablePropertySources from the given propertySources
object, preserving the original order of contained PropertySource objects. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add the given property source object with precedence immediately lower than
than the named relative property source.
| |||||||||||
Add the given property source object with precedence immediately higher
than the named relative property source.
| |||||||||||
Add the given property source object with highest precedence.
| |||||||||||
Add the given property source object with lowest precedence.
| |||||||||||
Return whether a property source with the given name is contained.
| |||||||||||
Return the property source with the given name,
null if not found. | |||||||||||
Return the precedence of the given property source,
-1 if not found. | |||||||||||
Remove and return the property source with the given name,
null if not found. | |||||||||||
Replace the property source with the given name with the given property source object.
| |||||||||||
Return the number of
PropertySource objects contained. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Ensure that the given property source is not being added relative to itself.
| |||||||||||
Log the removal of the given propertySource if it is present.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.lang.Iterable
| |||||||||||
From interface
org.springframework.core.env.PropertySources
|
Create a new MutablePropertySources
from the given propertySources
object, preserving the original order of contained PropertySource
objects.
Add the given property source object with precedence immediately lower than than the named relative property source.
Add the given property source object with precedence immediately higher than the named relative property source.
Add the given property source object with highest precedence.
Add the given property source object with lowest precedence.
Return whether a property source with the given name is contained.
name | the name of the property source to find
|
---|
Return the property source with the given name, null
if not found.
name | the name of the property source to find
|
---|
Return the precedence of the given property source, -1
if not found.
Remove and return the property source with the given name, null
if not found.
name | the name of the property source to find and remove |
---|
Replace the property source with the given name with the given property source object.
name | the name of the property source to find and replace |
---|---|
propertySource | the replacement property source |
IllegalArgumentException | if no property source with the given name is present |
---|
Ensure that the given property source is not being added relative to itself.
Log the removal of the given propertySource if it is present.