类 PropertySources
java.lang.Object
cn.taketoday.core.env.PropertySources
- 所有已实现的接口:
Iterable<PropertySource<?>>
Holder containing one or more
PropertySource objects.
Allows manipulation of contained property sources and provides a constructor
for copying an existing PropertySources instance.
Where precedence is mentioned in methods such as addFirst(cn.taketoday.core.env.PropertySource<?>)
and addLast(cn.taketoday.core.env.PropertySource<?>), this is with regard to the order in which property sources
will be searched when resolving a given property with a PropertyResolver.
- 从以下版本开始:
- 4.0
- 作者:
- Chris Beams, Juergen Hoeller, TODAY
- 另请参阅:
-
字段概要
字段 -
构造器概要
构造器构造器说明Create a newPropertySourcesobject.PropertySources(PropertySources propertySources) Create a newPropertySourcesfrom the given propertySources object, preserving the original order of containedPropertySourceobjects. -
方法概要
修饰符和类型方法说明voidaddAfter(String relativePropertySourceName, PropertySource<?> propertySource) Add the given property source object with precedence immediately lower than the named relative property source.private voidaddAtIndex(int index, PropertySource<?> propertySource) Add the given property source at a particular index in the list.voidaddBefore(String relativePropertySourceName, PropertySource<?> propertySource) Add the given property source object with precedence immediately higher than the named relative property source.voidaddFirst(PropertySource<?> propertySource) Add the given property source object with highest precedence.voidaddLast(PropertySource<?> propertySource) Add the given property source object with lowest precedence.protected voidassertLegalRelativeAddition(String relativePropertySourceName, PropertySource<?> propertySource) Ensure that the given property source is not being added relative to itself.private intAssert that the named property source is present and return its index.booleanReturn whether a property source with the given name is contained.Return the property source with the given name,nullif not found.iterator()intprecedenceOf(PropertySource<?> propertySource) Return the precedence of the given property source,-1if not found.Remove and return the property source with the given name,nullif not found.protected voidremoveIfPresent(PropertySource<?> propertySource) Remove the given property source if it is present.voidreplace(String name, PropertySource<?> propertySource) Replace the property source with the given name with the given property source object.intsize()Return the number ofPropertySourceobjects contained.Stream<PropertySource<?>>stream()Return a sequentialStreamcontaining the property sources.toString()
-
字段详细资料
-
propertySourceList
-
-
构造器详细资料
-
PropertySources
public PropertySources()Create a newPropertySourcesobject. -
PropertySources
Create a newPropertySourcesfrom the given propertySources object, preserving the original order of containedPropertySourceobjects.
-
-
方法详细资料
-
iterator
- 指定者:
iterator在接口中Iterable<PropertySource<?>>
-
spliterator
- 指定者:
spliterator在接口中Iterable<PropertySource<?>>
-
stream
Return a sequentialStreamcontaining the property sources. -
contains
Return whether a property source with the given name is contained.- 参数:
name- the name of the property source to find
-
get
Return the property source with the given name,nullif not found.- 参数:
name- the name of the property source to find
-
addFirst
Add the given property source object with highest precedence. -
addLast
Add the given property source object with lowest precedence. -
addBefore
Add the given property source object with precedence immediately higher than the named relative property source. -
addAfter
Add the given property source object with precedence immediately lower than the named relative property source. -
precedenceOf
Return the precedence of the given property source,-1if not found. -
remove
Remove and return the property source with the given name,nullif not found.- 参数:
name- the name of the property source to find and remove
-
replace
Replace the property source with the given name with the given property source object.- 参数:
name- the name of the property source to find and replacepropertySource- the replacement property source- 抛出:
IllegalArgumentException- if no property source with the given name is present- 另请参阅:
-
size
public int size()Return the number ofPropertySourceobjects contained. -
toString
-
assertLegalRelativeAddition
protected void assertLegalRelativeAddition(String relativePropertySourceName, PropertySource<?> propertySource) Ensure that the given property source is not being added relative to itself. -
removeIfPresent
Remove the given property source if it is present. -
addAtIndex
Add the given property source at a particular index in the list. -
assertPresentAndGetIndex
Assert that the named property source is present and return its index.- 参数:
name- name of the property source to find- 抛出:
IllegalArgumentException- if the named property source is not present
-