org.xerial.util.bean
Class XMLWalker

java.lang.Object
  extended by org.xerial.util.bean.TreeWalker
      extended by org.xerial.util.bean.XMLWalker

public class XMLWalker
extends TreeWalker

XMLWalker traverses XML data in the depth first manner.

Author:
leo

Constructor Summary
XMLWalker(TreeVisitor visitor, Element element)
          Constructs an XML DOM walker
XMLWalker(TreeVisitor visitor, Reader xmlDataReader)
          Constructs an XML stream walker
 
Method Summary
 TreeNode getSubTree()
          Gets the entire subtree beginning from the current node, and skips the descendants.
 void skipDescendants()
          Skip the descendants of the current node
 void walk()
          Start walking
 
Methods inherited from class org.xerial.util.bean.TreeWalker
getTreeVisitor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLWalker

public XMLWalker(TreeVisitor visitor,
                 Reader xmlDataReader)
          throws XMLException
Constructs an XML stream walker

Parameters:
visitor -
xmlDataReader - xml data stream
Throws:
XMLException - thrown when some error has found in the XML reader

XMLWalker

public XMLWalker(TreeVisitor visitor,
                 Element element)
Constructs an XML DOM walker

Parameters:
visitor -
element -
Method Detail

getSubTree

public TreeNode getSubTree()
                    throws BeanException
Description copied from class: TreeWalker
Gets the entire subtree beginning from the current node, and skips the descendants.

Specified by:
getSubTree in class TreeWalker
Returns:
TreeNode representation of the tree structured data beginning from the current node
Throws:
BeanException - TODO

skipDescendants

public void skipDescendants()
Description copied from class: TreeWalker
Skip the descendants of the current node

Specified by:
skipDescendants in class TreeWalker

walk

public void walk()
          throws XerialException
Description copied from class: TreeWalker
Start walking

Specified by:
walk in class TreeWalker
Throws:
XerialException


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