类 DefaultPropertiesPropertySource
java.lang.Object
org.springframework.core.env.PropertySource<Map<String,Object>>
org.springframework.core.env.EnumerablePropertySource<Map<String,Object>>
org.springframework.core.env.MapPropertySource
org.springframework.boot.DefaultPropertiesPropertySource
MapPropertySource containing default properties contributed directly to a
SpringApplication. By convention, the DefaultPropertiesPropertySource
is always the last property source in the Environment.- 从以下版本开始:
- 2.4.0
- 作者:
- Phillip Webb
-
嵌套类概要
从类继承的嵌套类/接口 org.springframework.core.env.PropertySource
PropertySource.StubPropertySource -
字段概要
字段从类继承的字段 org.springframework.core.env.PropertySource
logger, name, source -
构造器概要
构造器构造器说明DefaultPropertiesPropertySource(Map<String, Object> source) Create a newDefaultPropertiesPropertySourcewith the givenMapsource. -
方法概要
修饰符和类型方法说明static voidaddOrMerge(Map<String, Object> source, MutablePropertySources sources) Add a newDefaultPropertiesPropertySourceor merge with an existing one.static booleanhasMatchingName(PropertySource<?> propertySource) Returntrueif the given source is named 'defaultProperties'.static voidifNotEmpty(Map<String, Object> source, Consumer<DefaultPropertiesPropertySource> action) Create a newDefaultPropertiesPropertySourceinstance if the provided source is not empty.static voidmoveToEnd(ConfigurableEnvironment environment) Move the 'defaultProperties' property source so that it's the last source in the givenConfigurableEnvironment.static voidmoveToEnd(MutablePropertySources propertySources) Move the 'defaultProperties' property source so that it's the last source in the givenMutablePropertySources.从类继承的方法 org.springframework.core.env.MapPropertySource
containsProperty, getProperty, getPropertyNames
-
字段详细资料
-
NAME
The name of the 'default properties' property source.- 另请参阅:
-
-
构造器详细资料
-
DefaultPropertiesPropertySource
Create a newDefaultPropertiesPropertySourcewith the givenMapsource.- 参数:
source- the source map
-
-
方法详细资料
-
hasMatchingName
Returntrueif the given source is named 'defaultProperties'.- 参数:
propertySource- the property source to check- 返回:
trueif the name matches
-
ifNotEmpty
public static void ifNotEmpty(Map<String, Object> source, Consumer<DefaultPropertiesPropertySource> action) Create a newDefaultPropertiesPropertySourceinstance if the provided source is not empty.- 参数:
source- theMapsourceaction- the action used to consume theDefaultPropertiesPropertySource
-
addOrMerge
Add a newDefaultPropertiesPropertySourceor merge with an existing one.- 参数:
source- theMapsourcesources- the existing sources- 从以下版本开始:
- 2.4.4
-
moveToEnd
Move the 'defaultProperties' property source so that it's the last source in the givenConfigurableEnvironment.- 参数:
environment- the environment to update
-
moveToEnd
Move the 'defaultProperties' property source so that it's the last source in the givenMutablePropertySources.- 参数:
propertySources- the property sources to update
-