ehcache

net.sf.ehcache.config.generator.model
Class AbstractDepthFirstVisitor

java.lang.Object
  extended by net.sf.ehcache.config.generator.model.AbstractDepthFirstVisitor
All Implemented Interfaces:
NodeElementVisitor
Direct Known Subclasses:
XMLGeneratorVisitor

public abstract class AbstractDepthFirstVisitor
extends Object
implements NodeElementVisitor

Implementation of NodeElementVisitor that 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
AbstractDepthFirstVisitor()
           
 
Method Summary
protected  void endAttributes(NodeElement element)
          Finish visiting attributes of the element.
protected  void endChildren(NodeElement element)
          Finish visiting children of the element.
protected  void endElement(NodeElement element)
          Finish visiting the element.
protected  void startAttributes(NodeElement element)
          Starts visiting the attributes of the element.
protected  void startChildren(NodeElement element)
          Starts visiting children of the element.
protected  void startElement(NodeElement element)
          Starts visiting an element.
 void visit(NodeElement element)
          Visit the element
protected  void visitAttributes(NodeElement element, List<NodeAttribute> attributes)
          Visits the attributes of the element.
protected  void visitElement(NodeElement element)
          Visits the element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDepthFirstVisitor

public AbstractDepthFirstVisitor()
Method Detail

visit

public void visit(NodeElement element)
Visit the element

Specified by:
visit in interface NodeElementVisitor
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,
                               List<NodeAttribute> attributes)
Visits the attributes of the element. Override as needed

Parameters:
element - the element
attributes - 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

ehcache

Copyright 2001-2014, Terracotta, Inc.