util
Class PropertyLoader.OrderedProperties

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<Object,Object>
          extended by java.util.Properties
              extended by util.PropertyLoader.OrderedProperties
All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>
Enclosing class:
PropertyLoader

private static class PropertyLoader.OrderedProperties
extends Properties

Helper class to allow retaining of order in properties for more precise writing to files.


Field Summary
private  Map<String,String> backing
           
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
PropertyLoader.OrderedProperties(Map<String,String> back)
          Constructs new properites, whose get and set are diverted to the ordered map.
 
Method Summary
 Object get(Object key)
           
 String getProperty(String key)
          Looks into backing map.
 Enumeration keys()
          This method allows linked access.
 Object put(Object key, Object value)
          Overrides settting into the backing map.
 Object setProperty(String key, String value)
          Overrides settting into the backing map.
 
Methods inherited from class java.util.Properties
getProperty, list, list, load, load, loadFromXML, propertyNames, save, store, store, storeToXML, storeToXML, stringPropertyNames
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, hashCode, isEmpty, keySet, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

backing

private Map<String,String> backing
Constructor Detail

PropertyLoader.OrderedProperties

public PropertyLoader.OrderedProperties(Map<String,String> back)
Constructs new properites, whose get and set are diverted to the ordered map.

Method Detail

setProperty

public Object setProperty(String key,
                          String value)
Overrides settting into the backing map.

Overrides:
setProperty in class Properties

put

public Object put(Object key,
                  Object value)
Overrides settting into the backing map.

Specified by:
put in interface Map<Object,Object>
Overrides:
put in class Hashtable<Object,Object>

getProperty

public String getProperty(String key)
Looks into backing map. If mapping not present, return super.getProperty.

Overrides:
getProperty in class Properties

get

public Object get(Object key)
Specified by:
get in interface Map<Object,Object>
Overrides:
get in class Hashtable<Object,Object>
See Also:
put(Object, Object)

keys

public Enumeration keys()
This method allows linked access. No default properties are returned. This fuck's Enumeration which are directly cast to strings without check's in Sun's properties code. Note this method is annotated to suppress warnings, otherwise the generics cannot be cloned without issuing of a warning.

Overrides:
keys in class Hashtable<Object,Object>