org.enhydra.xml.dom
Class SimpleDOMTraversal

java.lang.Object
  |
  +--org.enhydra.xml.dom.SimpleDOMTraversal
Direct Known Subclasses:
LazyDOMSimpleTraversal

public class SimpleDOMTraversal
extends Object

Simple DOM traverser that calls a handler for every node in the DOM tree.


Inner Class Summary
static interface SimpleDOMTraversal.Handler
          Interface for node callback object.
 
Field Summary
protected  SimpleDOMTraversal.Handler fHandler
          Handler object for the traversal
 
Constructor Summary
SimpleDOMTraversal(SimpleDOMTraversal.Handler handler)
          Constructor.
 
Method Summary
static SimpleDOMTraversal getTraverser(SimpleDOMTraversal.Handler handler, Node node)
          Factory method to create a traverser based on the type of a document.
protected  void processAttributes(Node node)
          Process the attributes of an element.
protected  void processChildren(Node node)
          Process the children of a node.
 void processDocumentType(Document document)
          Process a DocumentType attribute of a Document node, if it exists.
protected  void processDocumentTypeContents(DocumentType documentType)
          Process the contents of a DocumentType node,
protected  void processNode(Node node)
          Processing based on node type.
 void traverse(Node root)
          Traverse a DOM tree or subtree.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fHandler

protected SimpleDOMTraversal.Handler fHandler
Handler object for the traversal
Constructor Detail

SimpleDOMTraversal

public SimpleDOMTraversal(SimpleDOMTraversal.Handler handler)
Constructor.
Parameters:
handler - The object that will be called to handle each node.
Method Detail

traverse

public void traverse(Node root)
Traverse a DOM tree or subtree.
Parameters:
root - The root of the DOM tree or subtree that is to be traversed.

processChildren

protected void processChildren(Node node)
Process the children of a node.

processAttributes

protected void processAttributes(Node node)
Process the attributes of an element.

processDocumentType

public void processDocumentType(Document document)
Process a DocumentType attribute of a Document node, if it exists.

processDocumentTypeContents

protected void processDocumentTypeContents(DocumentType documentType)
Process the contents of a DocumentType node,

processNode

protected void processNode(Node node)
Processing based on node type. All nodes go through here.

getTraverser

public static SimpleDOMTraversal getTraverser(SimpleDOMTraversal.Handler handler,
                                              Node node)
Factory method to create a traverser based on the type of a document.


Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.