org.springframework.core.env
Class MapPropertySource

java.lang.Object
  extended by org.springframework.core.env.PropertySource<T>
      extended by org.springframework.core.env.EnumerablePropertySource<Map<String,Object>>
          extended by org.springframework.core.env.MapPropertySource
Direct Known Subclasses:
PropertiesPropertySource

public class MapPropertySource
extends EnumerablePropertySource<Map<String,Object>>

PropertySource that reads keys and values from a Map object.

Since:
3.1
Author:
Chris Beams
See Also:
PropertiesPropertySource

Nested Class Summary
 
Nested classes/interfaces inherited from class org.springframework.core.env.PropertySource
PropertySource.StubPropertySource
 
Field Summary
 
Fields inherited from class org.springframework.core.env.EnumerablePropertySource
EMPTY_NAMES_ARRAY
 
Fields inherited from class org.springframework.core.env.PropertySource
logger, name, source
 
Constructor Summary
protected MapPropertySource(String name, Map<String,Object> source)
           
 
Method Summary
 Object getProperty(String key)
          Return the value associated with the given key, null if not found.
 String[] getPropertyNames()
          Return the names of all properties contained by the source object (never null).
 
Methods inherited from class org.springframework.core.env.EnumerablePropertySource
containsProperty
 
Methods inherited from class org.springframework.core.env.PropertySource
equals, getName, getSource, hashCode, named, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapPropertySource

protected MapPropertySource(String name,
                            Map<String,Object> source)
Method Detail

getProperty

public Object getProperty(String key)
Description copied from class: PropertySource
Return the value associated with the given key, null if not found.

Specified by:
getProperty in class PropertySource<Map<String,Object>>
Parameters:
key - the property key to find
See Also:
PropertyResolver.getRequiredProperty(String)

getPropertyNames

public String[] getPropertyNames()
Description copied from class: EnumerablePropertySource
Return the names of all properties contained by the source object (never null).

Specified by:
getPropertyNames in class EnumerablePropertySource<Map<String,Object>>