net.dpml.library.impl
Class DefaultDictionary

java.lang.Object
  extended bynet.dpml.library.impl.DefaultDictionary
All Implemented Interfaces:
Dictionary
Direct Known Subclasses:
DefaultLibrary, DefaultResource

public class DefaultDictionary
extends Object
implements Dictionary

Utility class used for construction of a module model from an XML source.

Version:
1.1.0
Author:
Digital Product Meta Library

Constructor Summary
DefaultDictionary(DefaultDictionary parent, AbstractDirective directive)
          Creation of a new dictionary.
 
Method Summary
 boolean getBooleanProperty(String key, boolean value)
          Return an boolean property value.
 int getIntegerProperty(String key, int value)
          Return an integer property value.
 String[] getLocalPropertyNames()
          Return the local property names associated with the dictionary.
 String getProperty(String key)
          Return a property value.
 String getProperty(String key, String value)
          Return a property value.
 String[] getPropertyNames()
          Return the property names associated with the dictionary.
 String resolve(String value)
          Evaluate and expand any symbolic references in the supplied value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDictionary

public DefaultDictionary(DefaultDictionary parent,
                         AbstractDirective directive)
Creation of a new dictionary. The dictionary provides support for property inheritance within the hierachy of of modules based an a single root virtual module. When handling a propety request the dictionary will attempt to resolve the property value using local property values. If the value is unresolved, the implemenetation will attempt to delegate the request to a parent dictionary if available.

Parameters:
parent - the parent dictionary (possibly null)
directive - an abstract directive containing local properties
Method Detail

getPropertyNames

public String[] getPropertyNames()
Return the property names associated with the dictionary.

Specified by:
getPropertyNames in interface Dictionary
Returns:
the array of property names

getLocalPropertyNames

public String[] getLocalPropertyNames()
Return the local property names associated with the dictionary.

Specified by:
getLocalPropertyNames in interface Dictionary
Returns:
the array of local property names

getProperty

public String getProperty(String key)
Return a property value.

Specified by:
getProperty in interface Dictionary
Parameters:
key - the property key
Returns:
the property value

getProperty

public String getProperty(String key,
                          String value)
Return a property value.

Specified by:
getProperty in interface Dictionary
Parameters:
key - the property key
value - the default value
Returns:
the property value

getIntegerProperty

public int getIntegerProperty(String key,
                              int value)
Return an integer property value.

Specified by:
getIntegerProperty in interface Dictionary
Parameters:
key - the property key
value - the default value
Returns:
the property value as an integer

getBooleanProperty

public boolean getBooleanProperty(String key,
                                  boolean value)
Return an boolean property value.

Specified by:
getBooleanProperty in interface Dictionary
Parameters:
key - the property key
value - the default value
Returns:
the property value as an boolean

resolve

public String resolve(String value)
Evaluate and expand any symbolic references in the supplied value.

Specified by:
resolve in interface Dictionary
Parameters:
value - the value to resolve
Returns:
the resolved value