org.n52.security.common.xml
Class DocumentTraverser

java.lang.Object
  extended by org.n52.security.common.xml.DocumentTraverser

public class DocumentTraverser
extends java.lang.Object

Class DocumentTraverser is able to traverse a dom document and calls a DocumentVisitor for each traversed node.

Version:
$Revision: $
Author:
Marko Reiprecht Created on 30.05.2008

Constructor Summary
DocumentTraverser()
           
 
Method Summary
 void traverseBreadthFirst(org.w3c.dom.Node node, DocumentVisitor visitor)
          Method traverses the node in breadth first order (silblings first).
 void traverseBreadthFirst(org.w3c.dom.Node node, DocumentVisitor visitor, boolean visitStartNode)
          Method traverses the node in breadth first order (silblings first).
 void traverseDepthFirst(org.w3c.dom.Node node, DocumentVisitor visitor)
          Method traverses the dom tree starting at node using depth first traversal (childs first).
 void traverseDepthFirst(org.w3c.dom.Node node, DocumentVisitor visitor, boolean visitStartNode)
          Method traverses the dom tree starting at node using depth first traversal, it skips the start node if visitStartNode==false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentTraverser

public DocumentTraverser()
Method Detail

traverseDepthFirst

public void traverseDepthFirst(org.w3c.dom.Node node,
                               DocumentVisitor visitor,
                               boolean visitStartNode)
Method traverses the dom tree starting at node using depth first traversal, it skips the start node if visitStartNode==false.

Parameters:
node - the startNode.
visitor - the visitor.
visitStartNode - the visitStartNode.

traverseDepthFirst

public void traverseDepthFirst(org.w3c.dom.Node node,
                               DocumentVisitor visitor)
Method traverses the dom tree starting at node using depth first traversal (childs first).

Parameters:
node - the startNode.
visitor - the visitor.

traverseBreadthFirst

public void traverseBreadthFirst(org.w3c.dom.Node node,
                                 DocumentVisitor visitor,
                                 boolean visitStartNode)
Method traverses the node in breadth first order (silblings first).

Parameters:
node - the node.
visitor - the visitor.
visitStartNode - the visitStartNode.

traverseBreadthFirst

public void traverseBreadthFirst(org.w3c.dom.Node node,
                                 DocumentVisitor visitor)
Method traverses the node in breadth first order (silblings first).

Parameters:
node - the node.
visitor - the visitor.


Copyright © 2004-2009 52north.org. All Rights Reserved.