Class HierarchicalConfigurationXMLReader.SAXVisitor
- java.lang.Object
-
- org.apache.commons.configuration2.tree.ConfigurationNodeVisitorAdapter<T>
-
- org.apache.commons.configuration2.HierarchicalConfigurationXMLReader.SAXVisitor
-
- All Implemented Interfaces:
ConfigurationNodeVisitor<T>
- Enclosing class:
- HierarchicalConfigurationXMLReader<T>
private final class HierarchicalConfigurationXMLReader.SAXVisitor extends ConfigurationNodeVisitorAdapter<T>
A specialized visitor class for generating SAX events for a hierarchical node structure.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
ATTR_TYPE
Constant for the attribute type.
-
Constructor Summary
Constructors Modifier Constructor Description private
SAXVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.xml.sax.Attributes
fetchAttributes(T node, NodeHandler<T> handler)
Returns an object with all attributes for the specified node.private java.lang.String
nodeName(T node, NodeHandler<T> handler)
Helper method for determining the name of a node.boolean
terminate()
Checks if iteration should be terminated.void
visitAfterChildren(T node, NodeHandler<T> handler)
Visits the specified node after its children have been processed.void
visitBeforeChildren(T node, NodeHandler<T> handler)
Visits the specified node.
-
-
-
Field Detail
-
ATTR_TYPE
private static final java.lang.String ATTR_TYPE
Constant for the attribute type.- See Also:
- Constant Field Values
-
-
Method Detail
-
fetchAttributes
protected org.xml.sax.Attributes fetchAttributes(T node, NodeHandler<T> handler)
Returns an object with all attributes for the specified node.- Parameters:
node
- the current nodehandler
- the node handler- Returns:
- an object with all attributes of this node
-
nodeName
private java.lang.String nodeName(T node, NodeHandler<T> handler)
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 checkedhandler
- the node handler- 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.- Specified by:
terminate
in interfaceConfigurationNodeVisitor<T>
- Overrides:
terminate
in classConfigurationNodeVisitorAdapter<T>
- Returns:
- a flag if iteration should be stopped
-
visitAfterChildren
public void visitAfterChildren(T node, NodeHandler<T> handler)
Visits the specified node after its children have been processed.- Specified by:
visitAfterChildren
in interfaceConfigurationNodeVisitor<T>
- Overrides:
visitAfterChildren
in classConfigurationNodeVisitorAdapter<T>
- Parameters:
node
- the actual nodehandler
- the node handler
-
visitBeforeChildren
public void visitBeforeChildren(T node, NodeHandler<T> handler)
Visits the specified node.- Specified by:
visitBeforeChildren
in interfaceConfigurationNodeVisitor<T>
- Overrides:
visitBeforeChildren
in classConfigurationNodeVisitorAdapter<T>
- Parameters:
node
- the actual nodehandler
- the node handler
-
-