org.apache.commons.configuration

Class HierarchicalConfigurationXMLReader.SAXVisitor

class HierarchicalConfigurationXMLReader.SAXVisitor extends HierarchicalConfiguration.NodeVisitor

A specialized visitor class for generating SAX events for a hierarchical node structure.
Field Summary
static StringATTR_TYPE
Constant for the attribute type.
Method Summary
protected AttributesfetchAttributes(HierarchicalConfiguration.Node node)
Returns an object with all attributes for the specified node.
booleanisAttributeNode(HierarchicalConfiguration.Node node)
Checks if the specified node is an attribute node.
StringnodeName(HierarchicalConfiguration.Node node)
Helper method for determining the name of a node.
booleanterminate()
Checks if iteration should be terminated.
voidvisitAfterChildren(HierarchicalConfiguration.Node node, ConfigurationKey key)
Visits the specified node after its children have been processed.
voidvisitBeforeChildren(HierarchicalConfiguration.Node node, ConfigurationKey key)
Visits the specified node.

Field Detail

ATTR_TYPE

private static final String ATTR_TYPE
Constant for the attribute type.

Method Detail

fetchAttributes

protected 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

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

nodeName

private 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

terminate

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

Returns: a flag if iteration should be stopped

visitAfterChildren

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

Parameters: node the actual node key the key of this node

visitBeforeChildren

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

Parameters: node the actual node key the key of this node