org.xerial.util.bean
Class TreeWalker

java.lang.Object
  extended by org.xerial.util.bean.TreeWalker
Direct Known Subclasses:
ANTLRWalker, JSONStreamWalker, MapWalker, XMLWalker

public abstract class TreeWalker
extends Object

An depth-first walker interface of tree structured data

Author:
leo

Constructor Summary
protected TreeWalker(TreeVisitor visitor)
           
 
Method Summary
abstract  TreeNode getSubTree()
          Gets the entire subtree beginning from the current node, and skips the descendants.
 TreeVisitor getTreeVisitor()
           
abstract  void skipDescendants()
          Skip the descendants of the current node
abstract  void walk()
          Start walking
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeWalker

protected TreeWalker(TreeVisitor visitor)
Method Detail

getTreeVisitor

public TreeVisitor getTreeVisitor()

walk

public abstract void walk()
                   throws XerialException
Start walking

Throws:
XerialException

skipDescendants

public abstract void skipDescendants()
Skip the descendants of the current node


getSubTree

public abstract TreeNode getSubTree()
                             throws BeanException
Gets the entire subtree beginning from the current node, and skips the descendants.

Returns:
TreeNode representation of the tree structured data beginning from the current node
Throws:
BeanException - TODO


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.1 Japan License.