Class MapPropertySource
java.lang.Object
org.springframework.core.env.PropertySource<Map<String,Object>>
 
org.springframework.core.env.EnumerablePropertySource<Map<String,Object>>
 
org.springframework.core.env.MapPropertySource
- Direct Known Subclasses:
- PropertiesPropertySource, SystemEnvironmentPropertySource
PropertySource that reads keys and values from a Map object.
The underlying map should not contain any null values in order to
comply with getProperty(String) and containsProperty(String) semantics.- Since:
- 3.1
- Author:
- Chris Beams, Juergen Hoeller
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class PropertySourcePropertySource.StubPropertySource
- 
Field SummaryFields inherited from class PropertySourcelogger, name, source
- 
Constructor SummaryConstructorsConstructorDescriptionMapPropertySource(String name, Map<String, Object> source) Create a newMapPropertySourcewith the given name andMap.
- 
Method SummaryModifier and TypeMethodDescriptionbooleancontainsProperty(String name) Return whether thisPropertySourcecontains a property with the given name.getProperty(String name) Return the value associated with the given name, ornullif not found.String[]Return the names of all properties contained by the source object (nevernull).
- 
Constructor Details- 
MapPropertySourceCreate a newMapPropertySourcewith the given name andMap.- Parameters:
- name- the associated name
- source- the Map source (without- nullvalues in order to get consistent- getProperty(String)and- containsProperty(String)behavior)
 
 
- 
- 
Method Details- 
getPropertyDescription copied from class:PropertySourceReturn the value associated with the given name, ornullif not found.- Specified by:
- getPropertyin class- PropertySource<Map<String,- Object>> 
- Parameters:
- name- the property to find
- See Also:
 
- 
containsPropertyDescription copied from class:EnumerablePropertySourceReturn whether thisPropertySourcecontains a property with the given name.This implementation checks for the presence of the given name within the EnumerablePropertySource.getPropertyNames()array.- Overrides:
- containsPropertyin class- EnumerablePropertySource<Map<String,- Object>> 
- Parameters:
- name- the name of the property to find
 
- 
getPropertyNamesDescription copied from class:EnumerablePropertySourceReturn the names of all properties contained by the source object (nevernull).- Specified by:
- getPropertyNamesin class- EnumerablePropertySource<Map<String,- Object>> 
 
 
-