org.apache.commons.configuration
Class HierarchicalConfigurationXMLReader.SAXVisitor

java.lang.Object
  extended by org.apache.commons.configuration.HierarchicalConfiguration.NodeVisitor
      extended by org.apache.commons.configuration.HierarchicalConfigurationXMLReader.SAXVisitor
Enclosing class:
HierarchicalConfigurationXMLReader

 class HierarchicalConfigurationXMLReader.SAXVisitor
extends HierarchicalConfiguration.NodeVisitor

A specialized visitor class for generating SAX events for a hierarchical node structure.


Field Summary
private static java.lang.String ATTR_TYPE
          Constant for the attribute type.
 
Constructor Summary
HierarchicalConfigurationXMLReader.SAXVisitor()
           
 
Method Summary
protected  org.xml.sax.Attributes fetchAttributes(HierarchicalConfiguration.Node node)
          Returns an object with all attributes for the specified node.
private  boolean isAttributeNode(HierarchicalConfiguration.Node node)
          Checks if the specified node is an attribute node.
private  java.lang.String nodeName(HierarchicalConfiguration.Node node)
          Helper method for determining the name of a node.
 boolean terminate()
          Checks if iteration should be terminated.
 void visitAfterChildren(HierarchicalConfiguration.Node node, ConfigurationKey key)
          Visits the specified node after its children have been processed.
 void visitBeforeChildren(HierarchicalConfiguration.Node node, ConfigurationKey key)
          Visits the specified node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_TYPE

private static final java.lang.String ATTR_TYPE
Constant for the attribute type.

See Also:
Constant Field Values
Constructor Detail

HierarchicalConfigurationXMLReader.SAXVisitor

HierarchicalConfigurationXMLReader.SAXVisitor()
Method Detail

visitAfterChildren

public void visitAfterChildren(HierarchicalConfiguration.Node node,
                               ConfigurationKey key)
Visits the specified node after its children have been processed.

Overrides:
visitAfterChildren in class HierarchicalConfiguration.NodeVisitor
Parameters:
node - the actual node
key - the key of this node

visitBeforeChildren

public void visitBeforeChildren(HierarchicalConfiguration.Node node,
                                ConfigurationKey key)
Visits the specified node.

Overrides:
visitBeforeChildren in class HierarchicalConfiguration.NodeVisitor
Parameters:
node - the actual node
key - the key of this node

terminate

public boolean terminate()
Checks if iteration should be terminated. This implementation stops iteration after an exception has occurred.

Overrides:
terminate in class HierarchicalConfiguration.NodeVisitor
Returns:
a flag if iteration should be stopped

fetchAttributes

protected org.xml.sax.Attributes fetchAttributes(HierarchicalConfiguration.Node node)
Returns an object with all attributes for the specified node.

Parameters:
node - the actual node
Returns:
an object with all attributes of this node

nodeName

private java.lang.String nodeName(HierarchicalConfiguration.Node node)
Helper method for determining the name of a node. If a node has no name (which is true for the root node), the specified default name will be used.

Parameters:
node - the node to be checked
Returns:
the name for this node

isAttributeNode

private boolean isAttributeNode(HierarchicalConfiguration.Node node)
Checks if the specified node is an attribute node. In the node hierarchy attributes are stored as normal child nodes, but with special names.

Parameters:
node - the node to be checked
Returns:
a flag if this is an attribute node