net.sf.molae.pipe.genimpl
Class ResourceBundleAsMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by net.sf.molae.pipe.genimpl.KeySetBasedMap<K,V>
          extended by net.sf.molae.pipe.genimpl.KeySetIteratorBasedMap<String,Object>
              extended by 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 Class Summary
 
Nested classes/interfaces inherited from class net.sf.molae.pipe.genimpl.KeySetIteratorBasedMap
KeySetIteratorBasedMap.KeySet
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
ResourceBundleAsMap(ResourceBundle base)
          Constructs a ResourceBundleAsMap object.
 
Method Summary
 Object get(Object key)
          Calls ResourceBundle.getObject(String) of the base object.
protected  Iterator<String> getKeySetIterator()
          Calls ResourceBundle.getKeys() of the base object.
 
Methods inherited from class net.sf.molae.pipe.genimpl.KeySetIteratorBasedMap
keySet, size
 
Methods inherited from class net.sf.molae.pipe.genimpl.KeySetBasedMap
clear, containsKey, entrySet, remove
 
Methods inherited from class java.util.AbstractMap
clone, containsValue, equals, hashCode, isEmpty, put, putAll, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceBundleAsMap

public ResourceBundleAsMap(ResourceBundle base)
Constructs a ResourceBundleAsMap object.

Parameters:
base - underlying ResourceBundle.
Throws:
NullPointerException - if the specified object is null.
Method Detail

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