edu.ucsb.adl.middleware
Class ExtendedProperties

java.lang.Object
  |
  +--java.util.Dictionary
        |
        +--java.util.Hashtable
              |
              +--java.util.Properties
                    |
                    +--edu.ucsb.adl.middleware.ExtendedProperties
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable
Direct Known Subclasses:
ConfigurationFile

public class ExtendedProperties
extends java.util.Properties

Extends class java.util.Properties to support macro substitution in property values.

Specifically, property values are interpreted literally except for at-sign-delimited operators, which are interpreted as follows:

@@
Insert literal at-sign.
@P@
Insert the value of property P.
In addition, if a complete property value is "@P@", the trailing at-sign may be omitted. For example, in the following property list,
a: iggledy
b: @a
c: h@b@-p@b@@@disorder.com
the value of property c is "higgledy-piggledy@disorder.com".

Version:
$Header: /export/home/gjanee/middleware/edu/ucsb/adl/middleware/RCS/ExtendedProperties.java,v 1.1 2004/09/21 17:16:55 gjanee Exp $

$Log: ExtendedProperties.java,v $ Revision 1.1 2004/09/21 17:16:55 gjanee Initial revision

Author:
Greg Janée
Alexandria Digital Library
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
ExtendedProperties()
          Creates an empty property list.
ExtendedProperties(java.util.Properties defaults)
          Creates an empty property list with the specified defaults.
 
Method Summary
 java.lang.String getProperty(java.lang.String property)
          Returns the value of a property.
 java.lang.String getPropertySafe(java.lang.String property)
          Identical to getProperty, but throws an exception instead of returning null.
 
Methods inherited from class java.util.Properties
getProperty, list, list, load, propertyNames, save, setProperty, store
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, 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
 

Constructor Detail

ExtendedProperties

public ExtendedProperties()
Creates an empty property list.


ExtendedProperties

public ExtendedProperties(java.util.Properties defaults)
Creates an empty property list with the specified defaults.

Parameters:
defaults - Default property values.
Method Detail

getProperty

public java.lang.String getProperty(java.lang.String property)
Returns the value of a property.

Overrides:
getProperty in class java.util.Properties
Parameters:
property - The property name.
Returns:
The property's value, or null if the property is not found or if a property directly or indirectly referred to by the property value is not found.

getPropertySafe

public java.lang.String getPropertySafe(java.lang.String property)
                                 throws InternalErrorException
Identical to getProperty, but throws an exception instead of returning null.

Parameters:
property - The property name.
Returns:
The property's value.
Throws:
InternalErrorException - If the property is not found or if a property directly or indirectly referred to by the property value is not found.