com.ibm.commerce.messaging.util
Class ConfigNodeParser

java.lang.Object
  |
  +--com.ibm.commerce.messaging.util.ConfigNodeParser
Direct Known Subclasses:
MessagingConfigNodeParser

public abstract class ConfigNodeParser
extends java.lang.Object

This Class is used to parse the hierarchical XML 'Node' Structure into a flat structure. It does this for any XML file. It adds 'END' tags to the end of ALL nodes for convenience. This is an abstract class which will be enhanced by other groups to provide their own cutom parsing.


Field Summary
static java.lang.String ATTRIBUTES
           
static java.lang.String ENDPREFIX
           
static java.lang.String XMLNAME
           
static java.lang.String XMLVALUE
           
 
Constructor Summary
ConfigNodeParser()
          Creates a new instance of the ConfigNodeParser.
 
Method Summary
 java.util.Hashtable getNextElement()
          Returns the next element in the flattened DOM structure.
 int length()
          Returns the length of the flattened DOM structure.
 java.util.Vector parse(org.w3c.dom.Node n)
          Parses the DOM indicated by Node into a Vector object.
protected  void recurseDOM(org.w3c.dom.Node dom, java.util.Vector traverse)
          This method performs a left-most-first traversal of a DOM node flattening the results out into a Vector.
 void reset()
          Resets the ConfigNodeParser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTES

public static final java.lang.String ATTRIBUTES

ENDPREFIX

public static final java.lang.String ENDPREFIX

XMLNAME

public static final java.lang.String XMLNAME

XMLVALUE

public static final java.lang.String XMLVALUE
Constructor Detail

ConfigNodeParser

public ConfigNodeParser()
Creates a new instance of the ConfigNodeParser.
Method Detail

getNextElement

public java.util.Hashtable getNextElement()
Returns the next element in the flattened DOM structure. If there is no next element, it will return a null object.
Returns:
java.util.Hashtable

length

public int length()
Returns the length of the flattened DOM structure.
Returns:
int

parse

public java.util.Vector parse(org.w3c.dom.Node n)
Parses the DOM indicated by Node into a Vector object. Returns and stores the result.
Parameters:
org.w3c.dom.Node - The node to parse.
Returns:
java.util.Vector Vector representation of the given Node

recurseDOM

protected void recurseDOM(org.w3c.dom.Node dom,
                          java.util.Vector traverse)
This method performs a left-most-first traversal of a DOM node flattening the results out into a Vector. The resulting vector is a vector of hashtables with the following elements : Name: the node's name as a String Value: the node's value as a String Attributes: the node's attributes as a Hashtable. The key of this hashtable will be the attributes defined in the DTD for configuration.
Parameters:
org.w3c.dom.Node - - The current node to parse.
java.util.Vector - - This is both an input and output. It represents the Vector being assemled.

reset

public void reset()
Resets the ConfigNodeParser.