TreeWalkerImpl.java revision 286
286N/A * reserved comment block 286N/A * DO NOT REMOVE OR ALTER! 286N/A * Copyright 1999-2002,2004 The Apache Software Foundation. 286N/A * Licensed under the Apache License, Version 2.0 (the "License"); 286N/A * you may not use this file except in compliance with the License. 286N/A * You may obtain a copy of the License at 286N/A * Unless required by applicable law or agreed to in writing, software 286N/A * distributed under the License is distributed on an "AS IS" BASIS, 286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 286N/A * See the License for the specific language governing permissions and 286N/A * limitations under the License. 286N/A/** This class implements the TreeWalker interface. 286N/A /** When TRUE, the children of entites references are returned in the iterator. */ 286N/A /** The whatToShow mask. */ 286N/A /** The NodeFilter reference. */ 286N/A /** The current Node. */ 286N/A // Implementation Note: No state is kept except the data above 286N/A // (fWhatToShow, fNodeFilter, fCurrentNode, fRoot) such that 286N/A // setters could be created for these data values and the 286N/A // implementation will still work. 286N/A /** Public constructor */ 286N/A /** Return the whatToShow value */ 286N/A /** Return the NodeFilter */ 286N/A /** Return whether children entity references are included in the iterator. */ 286N/A /** Return the current Node. */ 286N/A /** Return the current Node. */ 286N/A /** Return the parent Node from the current node, 286N/A * after applying filter, whatToshow. 286N/A * If result is not null, set the current Node. 286N/A /** Return the first child Node from the current node, 286N/A * after applying filter, whatToshow. 286N/A * If result is not null, set the current Node. 286N/A /** Return the last child Node from the current node, 286N/A * after applying filter, whatToshow. 286N/A * If result is not null, set the current Node. 286N/A /** Return the previous sibling Node from the current node, 286N/A * after applying filter, whatToshow. 286N/A * If result is not null, set the current Node. 286N/A /** Return the next sibling Node from the current node, 286N/A * after applying filter, whatToshow. 286N/A * If result is not null, set the current Node. 286N/A /** Return the previous Node from the current node, 286N/A * after applying filter, whatToshow. 286N/A * If result is not null, set the current Node. 286N/A // get the lastChild of result. 286N/A // if there is a lastChild which passes filters return it. 286N/A // otherwise return the previous sibling. 286N/A // otherwise return null. 286N/A /** Return the next Node from the current node, 286N/A * after applying filter, whatToshow. 286N/A * If result is not null, set the current Node. 286N/A // return parent's 1st sibling. 286N/A * Return the parent Node, from the input node 286N/A * after applying filter, whatToshow. 286N/A * The current node is not consulted or set. 286N/A //if (accept == NodeFilter.SKIP_NODE) // and REJECT too. 286N/A * Return the nextSibling Node, from the input node 286N/A * after applying filter, whatToshow. 286N/A * The current node is not consulted or set. 286N/A * Return the nextSibling Node, from the input node 286N/A * after applying filter, whatToshow. 286N/A * NEVER TRAVERSES ABOVE THE SPECIFIED ROOT NODE. 286N/A * The current node is not consulted or set. 286N/A //if (accept == NodeFilter.REJECT_NODE) 286N/A }
// getNextSibling(Node node) { 286N/A * Return the previous sibling Node, from the input node 286N/A * after applying filter, whatToshow. 286N/A * The current node is not consulted or set. 286N/A * Return the previousSibling Node, from the input node 286N/A * after applying filter, whatToshow. 286N/A * NEVER TRAVERSES ABOVE THE SPECIFIED ROOT NODE. 286N/A * The current node is not consulted or set. 286N/A //if (accept == NodeFilter.REJECT_NODE) 286N/A }
// getPreviousSibling(Node node) { 286N/A * Return the first child Node, from the input node 286N/A * after applying filter, whatToshow. 286N/A * The current node is not consulted or set. 286N/A //if (accept == NodeFilter.REJECT_NODE) 286N/A * Return the last child Node, from the input node 286N/A * after applying filter, whatToshow. 286N/A * The current node is not consulted or set. 286N/A //if (accept == NodeFilter.REJECT_NODE) 286N/A * The node whatToShow and the filter are combined into one result. */ 286N/A 7.1.2.4. Filters and whatToShow flags 286N/A Iterator and TreeWalker apply whatToShow flags before applying Filters. If a node is rejected by the 286N/A active whatToShow flags, a Filter will not be called to evaluate that node. When a node is rejected by 286N/A the active whatToShow flags, children of that node will still be considered, and Filters may be called to 286N/A // What to show has failed. See above excerpt from spec. 286N/A // Equivalent to FILTER_SKIP.