类 CompositePropertySource
java.lang.Object
cn.taketoday.core.env.PropertySource<T>
cn.taketoday.core.env.EnumerablePropertySource<Object>
cn.taketoday.core.env.CompositePropertySource
Composite
PropertySource implementation that iterates over a set of
PropertySource instances. Necessary in cases where multiple property sources
share the same name, e.g. when multiple values are supplied to @PropertySource.
instead of plain PropertySource, exposing getPropertyNames() based on the
accumulated property names from all contained sources (as far as possible).
- 从以下版本开始:
- 4.0
- 作者:
- Chris Beams, Juergen Hoeller, Phillip Webb, Harry Yang
-
嵌套类概要
从类继承的嵌套类/接口 cn.taketoday.core.env.PropertySource
PropertySource.ComparisonPropertySource, PropertySource.StubPropertySource -
字段概要
字段从类继承的字段 cn.taketoday.core.env.PropertySource
name, source -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidaddFirstPropertySource(PropertySource<?> propertySource) Add the givenPropertySourceto the start of the chain.voidaddPropertySource(PropertySource<?> propertySource) Add the givenPropertySourceto the end of the chain.booleancontainsProperty(String name) Return whether thisPropertySourcecontains a property with the given name.getProperty(String name) Return the value associated with the given name, ornullif not found.String[]Return the names of all properties contained by the source object (nevernull).Return all property sources that this composite source holds.toString()Produce concise output (type and name) if the current log level does not include debug.
-
字段详细资料
-
propertySources
-
-
构造器详细资料
-
CompositePropertySource
Create a newCompositePropertySource.- 参数:
name- the name of the property source
-
-
方法详细资料
-
getProperty
从类复制的说明:PropertySourceReturn the value associated with the given name, ornullif not found.- 指定者:
getProperty在类中PropertySource<Object>- 参数:
name- the property to find- 另请参阅:
-
containsProperty
从类复制的说明:EnumerablePropertySourceReturn whether thisPropertySourcecontains a property with the given name.This implementation checks for the presence of the given name within the
EnumerablePropertySource.getPropertyNames()array.- 覆盖:
containsProperty在类中EnumerablePropertySource<Object>- 参数:
name- the name of the property to find
-
getPropertyNames
从类复制的说明:EnumerablePropertySourceReturn the names of all properties contained by the source object (nevernull).- 指定者:
getPropertyNames在类中EnumerablePropertySource<Object>
-
addPropertySource
Add the givenPropertySourceto the end of the chain.- 参数:
propertySource- the PropertySource to add
-
addFirstPropertySource
Add the givenPropertySourceto the start of the chain.- 参数:
propertySource- the PropertySource to add
-
getPropertySources
Return all property sources that this composite source holds. -
toString
从类复制的说明:PropertySourceProduce concise output (type and name) if the current log level does not include debug. If debug is enabled, produce verbose output including the hash code of the PropertySource instance and every name/value property pair.This variable verbosity is useful as a property source such as system properties or environment variables may contain an arbitrary number of property pairs, potentially leading too difficult to read exception and log messages.
- 覆盖:
toString在类中PropertySource<Object>- 另请参阅:
-