Package org.springframework.core.env
Class PropertiesPropertySource
- java.lang.Object
- org.springframework.core.env.PropertySource<T>
- org.springframework.core.env.EnumerablePropertySource<Map<String,Object>>
- org.springframework.core.env.MapPropertySource
- org.springframework.core.env.PropertiesPropertySource
- Direct Known Subclasses:
MockPropertySource
,ResourcePropertySource
public class PropertiesPropertySource extends MapPropertySource
PropertySource
implementation that extracts properties from aProperties
object.Note that because a
Properties
object is technically an<Object, Object>
Hashtable
, one may contain non-String
keys or values. This implementation, however is restricted to accessing onlyString
-based keys and values, in the same fashion asProperties.getProperty(java.lang.String)
andProperties.setProperty(java.lang.String, java.lang.String)
.- Since:
- 3.1
- Author:
- Chris Beams, Juergen Hoeller
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.PropertySource
logger, name, source
Constructor Summary
Constructors Modifier Constructor Description protected
PropertiesPropertySource(String name, Map<String,Object> source)
PropertiesPropertySource(String name, Properties source)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]
getPropertyNames()
Return the names of all properties contained by the source object (nevernull
).Methods inherited from class org.springframework.core.env.MapPropertySource
containsProperty, getProperty
Constructor Detail
PropertiesPropertySource
public PropertiesPropertySource(String name, Properties source)
PropertiesPropertySource
protected PropertiesPropertySource(String name, Map<String,Object> source)
Method Detail
getPropertyNames
public String[] getPropertyNames()
Description copied from class:EnumerablePropertySource
Return the names of all properties contained by the source object (nevernull
).- Overrides:
getPropertyNames
in classMapPropertySource