public class OnePropertySourcesPlaceholderConfigurer
extends org.springframework.context.support.PropertySourcesPlaceholderConfigurer
Provides information about all configured PropertySource
properties in the getAppliedProperties()
method.
This properties map can be used in application beans to generate log information for the current settings.
In addition it also allows to blacklist any property values, such that the getAppliedProperties()
does not return
passwords or other sensitive data. The default value is password
, meaning that all properties containing
the string password
are blacklisted.
ENVIRONMENT_PROPERTIES_PROPERTY_SOURCE_NAME, LOCAL_PROPERTIES_PROPERTY_SOURCE_NAME
Constructor and Description |
---|
OnePropertySourcesPlaceholderConfigurer() |
Modifier and Type | Method and Description |
---|---|
Map<String,Map<String,Object>> |
getAppliedProperties()
Returns a map with the
PropertySource name as key and all configured properties in this PropertySource
as value. |
List<org.springframework.core.io.Resource> |
getResourceLocations()
Returns the configured property resource locations in the order they were loaded.
|
void |
postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) |
void |
setBlacklist(String blacklist)
Set the comma separated blacklist for property names which should be blacklisted in the properties returned from the
getAppliedProperties() method. |
void |
setLocation(org.springframework.core.io.Resource location) |
void |
setLocations(org.springframework.core.io.Resource... locations) |
void |
setPropertyEncoder(PropertyEncoder propertyEncoder)
Sets the property encoder used to decode the encoded properties.
|
getAppliedPropertySources, setEnvironment, setPropertySources
setBeanFactory, setBeanName, setIgnoreUnresolvablePlaceholders, setNullValue, setPlaceholderPrefix, setPlaceholderSuffix, setTrimValues, setValueSeparator
getOrder, setOrder
public OnePropertySourcesPlaceholderConfigurer()
public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) throws org.springframework.beans.BeansException
postProcessBeanFactory
in interface org.springframework.beans.factory.config.BeanFactoryPostProcessor
postProcessBeanFactory
in class org.springframework.context.support.PropertySourcesPlaceholderConfigurer
org.springframework.beans.BeansException
public Map<String,Map<String,Object>> getAppliedProperties()
Returns a map with the PropertySource
name as key and all configured properties in this PropertySource
as value. The properties are already processed by the configured blacklist.
PropertySource
properties configuredsetBlacklist(String)
public List<org.springframework.core.io.Resource> getResourceLocations()
Returns the configured property resource locations in the order they were loaded.
public void setPropertyEncoder(PropertyEncoder propertyEncoder)
Sets the property encoder used to decode the encoded properties.
propertyEncoder
- the property encoder used to decode the encoded properties.PropertyEncoder
public void setBlacklist(String blacklist)
Set the comma separated blacklist for property names which should be blacklisted in the properties returned from the getAppliedProperties()
method.
If the property name contains the blacklist value, then the property value gets replaced by the BLACKLIST_REPLACE_VALUE
.
blacklist
- a comma separated string with property names which should be blacklistedpublic void setLocation(org.springframework.core.io.Resource location)
setLocation
in class org.springframework.core.io.support.PropertiesLoaderSupport
public void setLocations(org.springframework.core.io.Resource... locations)
setLocations
in class org.springframework.core.io.support.PropertiesLoaderSupport
Copyright © 2010 - 2019 edorasware ag. All Rights Reserved.