com.pholser.util.properties
Class SubstitutableProperties
java.lang.Object
java.util.Dictionary<K,V>
java.util.Hashtable<Object,Object>
java.util.Properties
com.pholser.util.properties.SubstitutableProperties
- All Implemented Interfaces:
- PropertySource, Serializable, Cloneable, Map<Object,Object>
public class SubstitutableProperties
- extends Properties
- implements PropertySource
Properties class with support for property values which can be comprised of the values of other properties.
Such values specify other property keys delimited by [
and ]
.
Inspired by Enabling
Constant Substitution in Property Values.
- Author:
- Paul Holser
- See Also:
- Serialized Form
Methods inherited from class java.util.Properties |
getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames |
Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, remove, size, values |
SubstitutableProperties
public SubstitutableProperties()
- Creates an empty substitutable properties set.
SubstitutableProperties
public SubstitutableProperties(Properties defaults)
- Creates a substitutable properties set with defaults set to the keys and values of another properties set.
- Parameters:
defaults
- the default values for the new property set
getProperty
public String getProperty(String key)
- Overrides:
getProperty
in class Properties
propertyFor
public Object propertyFor(BoundProperty key)
- Description copied from interface:
PropertySource
- Gives the property value associated with the given key.
- Specified by:
propertyFor
in interface PropertySource
- Parameters:
key
- the key to look up
- Returns:
- the value associated with
key
, if there is one; else null
toString
public String toString()
- Overrides:
toString
in class Hashtable<Object,Object>
© Copyright 2009-2013 Paul R. Holser, Jr. All rights reserved. Licensed under The MIT License. pholser@alumni.rice.edu