类 InfoPropertiesInfoContributor<T extends org.springframework.boot.info.InfoProperties>
- java.lang.Object
- org.springframework.boot.actuate.info.InfoPropertiesInfoContributor<T>
- 类型参数:
T
- the type of theInfoProperties
to expose
- 所有已实现的接口:
InfoContributor
public abstract class InfoPropertiesInfoContributor<T extends org.springframework.boot.info.InfoProperties> extends Object implements InfoContributor
A baseInfoContributor
to expose anInfoProperties
.- 从以下版本开始:
- 1.4.0
嵌套类概要
嵌套类 修饰符和类型 类 说明 static class
InfoPropertiesInfoContributor.Mode
Defines how properties should be exposed.
构造器概要
构造器 限定符 构造器 说明 protected
InfoPropertiesInfoContributor(T properties, InfoPropertiesInfoContributor.Mode mode)
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected void
copyIfSet(Properties target, String key)
Copy the specified key to the targetProperties
if it is set.protected Map<String,Object>
extractContent(org.springframework.core.env.PropertySource<?> propertySource)
Extract the raw content based on the specifiedPropertySource
.protected Map<String,Object>
generateContent()
Extract the content to contribute to the info endpoint.protected InfoPropertiesInfoContributor.Mode
getMode()
Return the mode that should be used to expose the content.protected Map<String,Object>
getNestedMap(Map<String,Object> map, String key)
Return the nested map with the specified key or empty map if the specified map contains no mapping for the key.protected T
getProperties()
Return the properties that this instance manages.protected void
postProcessContent(Map<String,Object> content)
Post-process the content to expose.protected void
replaceValue(Map<String,Object> content, String key, Object value)
Replace thevalue
for the specified key if the value is notnull
.protected org.springframework.core.env.PropertySource<?>
toPropertySource()
Return thePropertySource
to use based on the chosenInfoPropertiesInfoContributor.Mode
.protected abstract org.springframework.core.env.PropertySource<?>
toSimplePropertySource()
Return aPropertySource
for theSIMPLE
mode.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.boot.actuate.info.InfoContributor
contribute
构造器详细资料
InfoPropertiesInfoContributor
protected InfoPropertiesInfoContributor(T properties, InfoPropertiesInfoContributor.Mode mode)
方法详细资料
getProperties
protected final T getProperties()
Return the properties that this instance manages.- 返回:
- the info properties
getMode
protected final InfoPropertiesInfoContributor.Mode getMode()
Return the mode that should be used to expose the content.- 返回:
- the mode
toSimplePropertySource
protected abstract org.springframework.core.env.PropertySource<?> toSimplePropertySource()
Return aPropertySource
for theSIMPLE
mode.- 返回:
- the property source for the simple model
- 另请参阅:
toPropertySource()
generateContent
protected Map<String,Object> generateContent()
Extract the content to contribute to the info endpoint.- 返回:
- the content to expose
- 另请参阅:
extractContent(PropertySource)
,postProcessContent(Map)
extractContent
protected Map<String,Object> extractContent(org.springframework.core.env.PropertySource<?> propertySource)
Extract the raw content based on the specifiedPropertySource
.- 参数:
propertySource
- the property source to use- 返回:
- the raw content
postProcessContent
protected void postProcessContent(Map<String,Object> content)
Post-process the content to expose. Elements can be added, changed or removed.- 参数:
content
- the content to expose
toPropertySource
protected org.springframework.core.env.PropertySource<?> toPropertySource()
Return thePropertySource
to use based on the chosenInfoPropertiesInfoContributor.Mode
.- 返回:
- the property source
copyIfSet
protected void copyIfSet(Properties target, String key)
Copy the specified key to the targetProperties
if it is set.- 参数:
target
- the target properties to updatekey
- the key
replaceValue
protected void replaceValue(Map<String,Object> content, String key, Object value)
Replace thevalue
for the specified key if the value is notnull
.- 参数:
content
- the content to exposekey
- the property to replacevalue
- the new value