Package org.springframework.core.env
Class PropertySourcesPropertyResolver
java.lang.Object
org.springframework.core.env.AbstractPropertyResolver
org.springframework.core.env.PropertySourcesPropertyResolver
- All Implemented Interfaces:
- ConfigurablePropertyResolver,- PropertyResolver
PropertyResolver implementation that resolves property values against
 an underlying set of PropertySources.- Since:
- 3.1
- Author:
- Chris Beams, Juergen Hoeller
- See Also:
- 
Field SummaryFields inherited from class org.springframework.core.env.AbstractPropertyResolverlogger
- 
Constructor SummaryConstructorsConstructorDescriptionPropertySourcesPropertyResolver(@Nullable PropertySources propertySources) Create a new resolver against the given property sources.
- 
Method SummaryModifier and TypeMethodDescriptionbooleancontainsProperty(String key) Return whether the given property key is available for resolution, i.e.getProperty(String key) Return the property value associated with the given key, ornullif the key cannot be resolved.<T> @Nullable TgetProperty(String key, Class<T> targetValueType) Return the property value associated with the given key, ornullif the key cannot be resolved.protected <T> @Nullable TgetProperty(String key, Class<T> targetValueType, boolean resolveNestedPlaceholders) Retrieve the specified property as a raw String, i.e.protected voidlogKeyFound(String key, PropertySource<?> propertySource, Object value) Log the given key as found in the givenPropertySource, resulting in the given value.Methods inherited from class org.springframework.core.env.AbstractPropertyResolverconvertValueIfNecessary, getConversionService, getProperty, getProperty, getRequiredProperty, getRequiredProperty, resolveNestedPlaceholders, resolvePlaceholders, resolveRequiredPlaceholders, setConversionService, setEscapeCharacter, setIgnoreUnresolvableNestedPlaceholders, setPlaceholderPrefix, setPlaceholderSuffix, setRequiredProperties, setValueSeparator, validateRequiredProperties
- 
Constructor Details- 
PropertySourcesPropertyResolverCreate a new resolver against the given property sources.- Parameters:
- propertySources- the set of- PropertySourceobjects to use
 
 
- 
- 
Method Details- 
containsPropertyDescription copied from interface:PropertyResolverReturn whether the given property key is available for resolution, i.e. if the value for the given key is notnull.- Specified by:
- containsPropertyin interface- PropertyResolver
- Overrides:
- containsPropertyin class- AbstractPropertyResolver
 
- 
getPropertyDescription copied from interface:PropertyResolverReturn the property value associated with the given key, ornullif the key cannot be resolved.- Specified by:
- getPropertyin interface- PropertyResolver
- Overrides:
- getPropertyin class- AbstractPropertyResolver
- Parameters:
- key- the property name to resolve
- See Also:
 
- 
getPropertyDescription copied from interface:PropertyResolverReturn the property value associated with the given key, ornullif the key cannot be resolved.- Parameters:
- key- the property name to resolve
- targetValueType- the expected type of the property value
- See Also:
 
- 
getPropertyAsRawStringDescription copied from class:AbstractPropertyResolverRetrieve the specified property as a raw String, i.e. without resolution of nested placeholders.- Specified by:
- getPropertyAsRawStringin class- AbstractPropertyResolver
- Parameters:
- key- the property name to resolve
- Returns:
- the property value or nullif none found
 
- 
getProperty
- 
logKeyFoundLog the given key as found in the givenPropertySource, resulting in the given value.The default implementation writes a debug log message with key and source. As of 4.3.3, this does not log the value anymore in order to avoid accidental logging of sensitive settings. Subclasses may override this method to change the log level and/or log message, including the property's value if desired. - Parameters:
- key- the key found
- propertySource- the- PropertySourcethat the key has been found in
- value- the corresponding value
- Since:
- 4.3.1
 
 
-