Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxp/src/org/w3c/dom/traversal/DocumentTraversal.java
86410 views
/*1* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation. Oracle designates this6* particular file as subject to the "Classpath" exception as provided7* by Oracle in the LICENSE file that accompanied this code.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*/2324/*25* This file is available under and governed by the GNU General Public26* License version 2 only, as published by the Free Software Foundation.27* However, the following notice accompanied the original version of this28* file and, per its terms, should not be removed:29*30* Copyright (c) 2000 World Wide Web Consortium,31* (Massachusetts Institute of Technology, Institut National de32* Recherche en Informatique et en Automatique, Keio University). All33* Rights Reserved. This program is distributed under the W3C's Software34* Intellectual Property License. This program is distributed in the35* hope that it will be useful, but WITHOUT ANY WARRANTY; without even36* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR37* PURPOSE.38* See W3C License http://www.w3.org/Consortium/Legal/ for more details.39*/4041package org.w3c.dom.traversal;4243import org.w3c.dom.Node;44import org.w3c.dom.DOMException;4546/**47* <code>DocumentTraversal</code> contains methods that create48* <code>NodeIterators</code> and <code>TreeWalkers</code> to traverse a49* node and its children in document order (depth first, pre-order50* traversal, which is equivalent to the order in which the start tags occur51* in the text representation of the document). In DOMs which support the52* Traversal feature, <code>DocumentTraversal</code> will be implemented by53* the same objects that implement the Document interface.54* <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>.55* @since DOM Level 256*/57public interface DocumentTraversal {58/**59* Create a new <code>NodeIterator</code> over the subtree rooted at the60* specified node.61* @param root The node which will be iterated together with its62* children. The <code>NodeIterator</code> is initially positioned63* just before this node. The <code>whatToShow</code> flags and the64* filter, if any, are not considered when setting this position. The65* root must not be <code>null</code>.66* @param whatToShow This flag specifies which node types may appear in67* the logical view of the tree presented by the68* <code>NodeIterator</code>. See the description of69* <code>NodeFilter</code> for the set of possible <code>SHOW_</code>70* values.These flags can be combined using <code>OR</code>.71* @param filter The <code>NodeFilter</code> to be used with this72* <code>NodeIterator</code>, or <code>null</code> to indicate no73* filter.74* @param entityReferenceExpansion The value of this flag determines75* whether entity reference nodes are expanded.76* @return The newly created <code>NodeIterator</code>.77* @exception DOMException78* NOT_SUPPORTED_ERR: Raised if the specified <code>root</code> is79* <code>null</code>.80*/81public NodeIterator createNodeIterator(Node root,82int whatToShow,83NodeFilter filter,84boolean entityReferenceExpansion)85throws DOMException;8687/**88* Create a new <code>TreeWalker</code> over the subtree rooted at the89* specified node.90* @param root The node which will serve as the <code>root</code> for the91* <code>TreeWalker</code>. The <code>whatToShow</code> flags and the92* <code>NodeFilter</code> are not considered when setting this value;93* any node type will be accepted as the <code>root</code>. The94* <code>currentNode</code> of the <code>TreeWalker</code> is95* initialized to this node, whether or not it is visible. The96* <code>root</code> functions as a stopping point for traversal97* methods that look upward in the document structure, such as98* <code>parentNode</code> and nextNode. The <code>root</code> must99* not be <code>null</code>.100* @param whatToShow This flag specifies which node types may appear in101* the logical view of the tree presented by the102* <code>TreeWalker</code>. See the description of103* <code>NodeFilter</code> for the set of possible <code>SHOW_</code>104* values.These flags can be combined using <code>OR</code>.105* @param filter The <code>NodeFilter</code> to be used with this106* <code>TreeWalker</code>, or <code>null</code> to indicate no filter.107* @param entityReferenceExpansion If this flag is false, the contents of108* <code>EntityReference</code> nodes are not presented in the logical109* view.110* @return The newly created <code>TreeWalker</code>.111* @exception DOMException112* NOT_SUPPORTED_ERR: Raised if the specified <code>root</code> is113* <code>null</code>.114*/115public TreeWalker createTreeWalker(Node root,116int whatToShow,117NodeFilter filter,118boolean entityReferenceExpansion)119throws DOMException;120121}122123124