net.sf.molae.pipe.genimpl
Class ResourceBundleAsMap
java.lang.Object
java.util.AbstractMap<K,V>
net.sf.molae.pipe.genimpl.KeySetBasedMap<K,V>
net.sf.molae.pipe.genimpl.KeySetIteratorBasedMap<String,Object>
net.sf.molae.pipe.genimpl.ResourceBundleAsMap
- All Implemented Interfaces:
- Map<String,Object>
public final class ResourceBundleAsMap
- extends KeySetIteratorBasedMap<String,Object>
Guises a ResourceBundle as a Map.
| Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
ResourceBundleAsMap
public ResourceBundleAsMap(ResourceBundle base)
- Constructs a ResourceBundleAsMap object.
- Parameters:
base - underlying ResourceBundle.
- Throws:
NullPointerException - if the specified object is
null.
get
public Object get(Object key)
- Calls
ResourceBundle.getObject(String) of the base object.
- Specified by:
get in interface Map<String,Object>- Specified by:
get in class KeySetBasedMap<String,Object>
- Parameters:
key - key whose associated value is to be returned.
- Returns:
- the value to which this map maps the specified key.
- Throws:
ClassCastException - if the specified key is not a String.
NullPointerException - if key is null.
getKeySetIterator
protected Iterator<String> getKeySetIterator()
- Calls
ResourceBundle.getKeys() of the base object.
- Specified by:
getKeySetIterator in class KeySetIteratorBasedMap<String,Object>
- Returns:
- the iterator of the key set