org.webmacro.util
Class SparseProperties
java.lang.Object
java.util.Dictionary
java.util.Hashtable
java.util.Properties
org.webmacro.util.SparseProperties
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.Map, java.io.Serializable
- public class SparseProperties
- extends java.util.Properties
Implement a behavior allowing for undefined properties to return
a useful default value such as "" for a string, "0.00" for
numeric properties, and so forth.
A specific default can always be used as is done for string properties in the
base class.
- See Also:
- Serialized Form
Field Summary |
protected java.lang.Object |
globalDefault
The global default value for all requests is "" |
Fields inherited from class java.util.Properties |
defaults |
Method Summary |
java.lang.Object |
get(java.lang.Object key)
Gets the object but returns the default value if not present. |
java.lang.Object |
get(java.lang.Object key,
java.lang.Object defaultValue)
Gets the object but returns the default value if not present. |
Methods inherited from class java.util.Properties |
getProperty, getProperty, list, list, load, propertyNames, save, setProperty, store |
Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
globalDefault
protected java.lang.Object globalDefault
- The global default value for all requests is ""
SparseProperties
public SparseProperties()
SparseProperties
public SparseProperties(java.util.Properties defaults)
SparseProperties
public SparseProperties(java.lang.Object globalDefault)
SparseProperties
public SparseProperties(java.util.Properties defaults,
java.lang.Object globalDefault)
get
public java.lang.Object get(java.lang.Object key)
- Gets the object but returns the default value if not present.
get
public java.lang.Object get(java.lang.Object key,
java.lang.Object defaultValue)
- Gets the object but returns the default value if not present.