< prev index next >

jaxp/src/java.xml/share/classes/org/w3c/dom/traversal/TreeWalker.java

Print this page




  43 
  44 import org.w3c.dom.Node;
  45 import org.w3c.dom.DOMException;
  46 
  47 /**
  48  * <code>TreeWalker</code> objects are used to navigate a document tree or
  49  * subtree using the view of the document defined by their
  50  * <code>whatToShow</code> flags and filter (if any). Any function which
  51  * performs navigation using a <code>TreeWalker</code> will automatically
  52  * support any view defined by a <code>TreeWalker</code>.
  53  * <p>Omitting nodes from the logical view of a subtree can result in a
  54  * structure that is substantially different from the same subtree in the
  55  * complete, unfiltered document. Nodes that are siblings in the
  56  * <code>TreeWalker</code> view may be children of different, widely
  57  * separated nodes in the original view. For instance, consider a
  58  * <code>NodeFilter</code> that skips all nodes except for Text nodes and
  59  * the root node of a document. In the logical view that results, all text
  60  * nodes will be siblings and appear as direct children of the root node, no
  61  * matter how deeply nested the structure of the original document.
  62  * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
  63  * @since 1.9, DOM Level 2
  64  */
  65 public interface TreeWalker {
  66     /**
  67      * The <code>root</code> node of the <code>TreeWalker</code>, as specified
  68      * when it was created.
  69      */
  70     public Node getRoot();
  71 
  72     /**
  73      * This attribute determines which node types are presented via the
  74      * <code>TreeWalker</code>. The available set of constants is defined in
  75      * the <code>NodeFilter</code> interface.  Nodes not accepted by
  76      * <code>whatToShow</code> will be skipped, but their children may still
  77      * be considered. Note that this skip takes precedence over the filter,
  78      * if any.
  79      */
  80     public int getWhatToShow();
  81 
  82     /**
  83      * The filter used to screen nodes.




  43 
  44 import org.w3c.dom.Node;
  45 import org.w3c.dom.DOMException;
  46 
  47 /**
  48  * <code>TreeWalker</code> objects are used to navigate a document tree or
  49  * subtree using the view of the document defined by their
  50  * <code>whatToShow</code> flags and filter (if any). Any function which
  51  * performs navigation using a <code>TreeWalker</code> will automatically
  52  * support any view defined by a <code>TreeWalker</code>.
  53  * <p>Omitting nodes from the logical view of a subtree can result in a
  54  * structure that is substantially different from the same subtree in the
  55  * complete, unfiltered document. Nodes that are siblings in the
  56  * <code>TreeWalker</code> view may be children of different, widely
  57  * separated nodes in the original view. For instance, consider a
  58  * <code>NodeFilter</code> that skips all nodes except for Text nodes and
  59  * the root node of a document. In the logical view that results, all text
  60  * nodes will be siblings and appear as direct children of the root node, no
  61  * matter how deeply nested the structure of the original document.
  62  * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>.
  63  * @since 9, DOM Level 2
  64  */
  65 public interface TreeWalker {
  66     /**
  67      * The <code>root</code> node of the <code>TreeWalker</code>, as specified
  68      * when it was created.
  69      */
  70     public Node getRoot();
  71 
  72     /**
  73      * This attribute determines which node types are presented via the
  74      * <code>TreeWalker</code>. The available set of constants is defined in
  75      * the <code>NodeFilter</code> interface.  Nodes not accepted by
  76      * <code>whatToShow</code> will be skipped, but their children may still
  77      * be considered. Note that this skip takes precedence over the filter,
  78      * if any.
  79      */
  80     public int getWhatToShow();
  81 
  82     /**
  83      * The filter used to screen nodes.


< prev index next >