类 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 newDefaultPropertiesPropertySource
with the givenMap
source. -
方法概要
修饰符和类型方法说明static void
addOrMerge
(Map<String, Object> source, MutablePropertySources sources) Add a newDefaultPropertiesPropertySource
or merge with an existing one.static boolean
hasMatchingName
(PropertySource<?> propertySource) Returntrue
if the given source is named 'defaultProperties'.static void
ifNotEmpty
(Map<String, Object> source, Consumer<DefaultPropertiesPropertySource> action) Create a newDefaultPropertiesPropertySource
instance if the provided source is not empty.static void
moveToEnd
(ConfigurableEnvironment environment) Move the 'defaultProperties' property source so that it's the last source in the givenConfigurableEnvironment
.static void
moveToEnd
(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 newDefaultPropertiesPropertySource
with the givenMap
source.- 参数:
source
- the source map
-
-
方法详细资料
-
hasMatchingName
Returntrue
if the given source is named 'defaultProperties'.- 参数:
propertySource
- the property source to check- 返回:
true
if the name matches
-
ifNotEmpty
public static void ifNotEmpty(Map<String, Object> source, Consumer<DefaultPropertiesPropertySource> action) Create a newDefaultPropertiesPropertySource
instance if the provided source is not empty.- 参数:
source
- theMap
sourceaction
- the action used to consume theDefaultPropertiesPropertySource
-
addOrMerge
Add a newDefaultPropertiesPropertySource
or merge with an existing one.- 参数:
source
- theMap
sourcesources
- 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
-