com.finalist.jaggenerator
Class ConfigManager

java.lang.Object
  extended bycom.finalist.jaggenerator.ConfigManager

public class ConfigManager
extends java.lang.Object

The ConfigManager deals with loading / saving JAG configuraton information to/from an XML config file.

Author:
Michael O'Connor - Finalist IT Group

Field Summary
protected static java.lang.String XMLTAG_GUI
          The name of the XML tag that contains the GUI configuration properties.
 
Method Summary
 org.w3c.dom.Document getDocument()
          Gets the config information, parsed as an XML document.
static ConfigManager getInstance()
          The ConfigManager is a singleton - this method obtains the one and only instance.
 java.util.Map retrievePropertiesFromXML(java.lang.String rootElementName)
          Creates a Map that contains key-value pairs representing the XML elements / text nodes that fall underneath the node with the supplied name.
 void save()
          Saves the configurations to the XML JAG_CONFIG_FILE.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XMLTAG_GUI

protected static final java.lang.String XMLTAG_GUI
The name of the XML tag that contains the GUI configuration properties.

See Also:
Constant Field Values
Method Detail

getInstance

public static ConfigManager getInstance()
The ConfigManager is a singleton - this method obtains the one and only instance.

Returns:

getDocument

public org.w3c.dom.Document getDocument()
Gets the config information, parsed as an XML document.

NOTE: this Document is provided READ-ONLY - any changes made to the doc will NOT be persisted!

Returns:
the doc.

retrievePropertiesFromXML

public java.util.Map retrievePropertiesFromXML(java.lang.String rootElementName)
Creates a Map that contains key-value pairs representing the XML elements / text nodes that fall underneath the node with the supplied name. If there are more than one node with the supplied name, only the first of these is translated into a Map.

Property values are of type String[] : if a given property within the Map occurs more than once in the XML there will be more than one String in the array.

Parameters:
rootElementName - The name of the parent node whose children we want making into a Properties object.
Returns:
a Map whose keys are Strings and whose values are String[]. The map will be empty (but never null) if there are no nodes with the name specified in rootElementName.

save

public void save()
Saves the configurations to the XML JAG_CONFIG_FILE.



Copyright © 2003-2005 SourceForge. All Rights Reserved.