Class AbstractDepthFirstVisitor
- java.lang.Object
-
- net.sf.ehcache.config.generator.model.AbstractDepthFirstVisitor
-
- All Implemented Interfaces:
NodeElementVisitor
- Direct Known Subclasses:
XMLGeneratorVisitor
public abstract class AbstractDepthFirstVisitor extends java.lang.Object implements NodeElementVisitor
Implementation ofNodeElementVisitorthat does a depth-first traversal of the element. Depth first means the visit starts at the element and goes deeper and deeper in each child element until there are no children and then backtracks, doing the same thing for each children in each child element. This class is an abstract class and provides empty methods that sub-classes can override as needed. The visit methods in this class are called in this order for each element visited by this visitor:- Author:
- Abhishek Sanoujam
-
-
Constructor Summary
Constructors Constructor Description AbstractDepthFirstVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidendAttributes(NodeElement element)Finish visiting attributes of the element.protected voidendChildren(NodeElement element)Finish visiting children of the element.protected voidendElement(NodeElement element)Finish visiting the element.protected voidstartAttributes(NodeElement element)Starts visiting the attributes of the element.protected voidstartChildren(NodeElement element)Starts visiting children of the element.protected voidstartElement(NodeElement element)Starts visiting an element.voidvisit(NodeElement element)Visit the elementprotected voidvisitAttributes(NodeElement element, java.util.List<NodeAttribute> attributes)Visits the attributes of the element.protected voidvisitElement(NodeElement element)Visits the element.
-
-
-
Method Detail
-
visit
public void visit(NodeElement element)
Visit the element- Specified by:
visitin interfaceNodeElementVisitor- Parameters:
element- the element to be visited
-
startElement
protected void startElement(NodeElement element)
Starts visiting an element. Override as needed- Parameters:
element- the element
-
startAttributes
protected void startAttributes(NodeElement element)
Starts visiting the attributes of the element. Override as needed- Parameters:
element- the element
-
visitAttributes
protected void visitAttributes(NodeElement element, java.util.List<NodeAttribute> attributes)
Visits the attributes of the element. Override as needed- Parameters:
element- the elementattributes- the attributes
-
endAttributes
protected void endAttributes(NodeElement element)
Finish visiting attributes of the element. Override as needed- Parameters:
element- the element
-
visitElement
protected void visitElement(NodeElement element)
Visits the element. Override as needed- Parameters:
element- the element
-
startChildren
protected void startChildren(NodeElement element)
Starts visiting children of the element. Override as needed- Parameters:
element- the element
-
endChildren
protected void endChildren(NodeElement element)
Finish visiting children of the element. Override as needed- Parameters:
element- the element
-
endElement
protected void endElement(NodeElement element)
Finish visiting the element. Override as needed- Parameters:
element- the element
-
-