Package PIRL.Configuration

A Configuration provides a convenient means of maintaining a Parameter list used for configuration management.


Class Summary
Configuration A Configuration maintains a Parameter list used for configuration management.

Exception Summary
Configuration_Exception The excpetion thrown from the PIRL.Configuration package.

Package PIRL.Configuration Description

A Configuration provides a convenient means of maintaining a Parameter list used for configuration management.

The Configuration parameters may be assembled from any source of Parameter Value Language (PVL) statements - a file, URL, or system resource such as a jar file - or an existing Parameter object. Any "@Include" parameter found is recursively processed as a source of PVL statements to replace the "@Include" parameter. A set of basic default parameters is always provided, and all environment variables are added to the Configuration. A new Configuration has its parameters coalesced so that groups of parameters of the same name result in a single group, and duplicate parameters are removed (or throw an exception) on either a first or last preference basis.

Methods are provided to get parameter values by name. The name may be a simple name or an absolute or relative pathname. The name may be treated as case sensitive or not. When a parameter value is the name of another parameter the first parameter may be treated as a link to the value of the second parameter. When a named parameter can not be found, a search up the Parameter hierarchy may be automatically done for a parameter of the specified name; this allows default values to be provided at a higher level for all parameter groups at a lower level. All parameter values are returned as Strings. The value of a parameter may be a single value or an Array of values; if desired, only the first value of an Array will be obtained. An entire Group of parameters may be obtained as a sub-Configuration, with all parameters from higher levels than the group automatically incorporated into the new Configuration.

Methods are provided to set parameter values by name using the String representation of any Object. The setting of the new value may be conditional on a parameter of the specified name not already being present in the Configuration, and all occurances of a parameter name may be set. These methods indicate when the value of an existing parameter was changed as opposed to creating a new parameter. Parameter values may also be set using the name and value of another Parameter or from an array of name, value String pairs.

Methods are provided to remove parameters by name. Either a specific parameter or all parameters with a matching name may be removed.

Because a Configuration is a subclass of Parameter, it may be manipulated using any of the Parameter methods.

See Also:


Copyright (C) \ 2003-2009 Bradford Castalia, University of Arizona