com.pholser.util.properties
Class SubstitutableProperties

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<Object,Object>
          extended by java.util.Properties
              extended by 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

Constructor Summary
SubstitutableProperties()
          Creates an empty substitutable properties set.
SubstitutableProperties(Properties defaults)
          Creates a substitutable properties set with defaults set to the keys and values of another properties set.
 
Method Summary
 String getProperty(String key)
           
 Object propertyFor(BoundProperty key)
          Gives the property value associated with the given key.
 String toString()
           
 
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
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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
Method Detail

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