<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_18) on Sun Jun 12 19:55:32 JST 2011 --> <TITLE> NodeIterator (JAXP 1.4, DOM3, SAX2.0.2(sax2r3), StAX 1.0, SAC 1.3) </TITLE> <META NAME="date" CONTENT="2011-06-12"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="NodeIterator (JAXP 1.4, DOM3, SAX2.0.2(sax2r3), StAX 1.0, SAC 1.3)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../org/w3c/dom/traversal/NodeFilter.html" title="interface in org.w3c.dom.traversal"><B>PREV CLASS</B></A> <A HREF="../../../../org/w3c/dom/traversal/TreeWalker.html" title="interface in org.w3c.dom.traversal"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/w3c/dom/traversal/NodeIterator.html" target="_top"><B>FRAMES</B></A> <A HREF="NodeIterator.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.w3c.dom.traversal</FONT> <BR> Interface NodeIterator</H2> <HR> <DL> <DT><PRE>public interface <B>NodeIterator</B></DL> </PRE> <P> <code>NodeIterators</code> are used to step through a set of nodes, e.g. the set of nodes in a <code>NodeList</code>, the document subtree governed by a particular <code>Node</code>, the results of a query, or any other set of nodes. The set of nodes to be iterated is determined by the implementation of the <code>NodeIterator</code>. DOM Level 2 specifies a single <code>NodeIterator</code> implementation for document-order traversal of a document subtree. Instances of these <code>NodeIterators</code> are created by calling <code>DocumentTraversal</code><code>.createNodeIterator()</code>. <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>. <P> <P> <DL> <DT><B>Since:</B></DT> <DD>DOM Level 2</DD> </DL> <HR> <P> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/traversal/NodeIterator.html#detach()">detach</A></B>()</CODE> <BR> Detaches the <code>NodeIterator</code> from the set which it iterated over, releasing any computational resources and placing the <code>NodeIterator</code> in the INVALID state.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/traversal/NodeIterator.html#getExpandEntityReferences()">getExpandEntityReferences</A></B>()</CODE> <BR> The value of this flag determines whether the children of entity reference nodes are visible to the <code>NodeIterator</code>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../org/w3c/dom/traversal/NodeFilter.html" title="interface in org.w3c.dom.traversal">NodeFilter</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/traversal/NodeIterator.html#getFilter()">getFilter</A></B>()</CODE> <BR> The <code>NodeFilter</code> used to screen nodes.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../org/w3c/dom/Node.html" title="interface in org.w3c.dom">Node</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/traversal/NodeIterator.html#getRoot()">getRoot</A></B>()</CODE> <BR> The root node of the <code>NodeIterator</code>, as specified when it was created.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/traversal/NodeIterator.html#getWhatToShow()">getWhatToShow</A></B>()</CODE> <BR> This attribute determines which node types are presented via the <code>NodeIterator</code>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../org/w3c/dom/Node.html" title="interface in org.w3c.dom">Node</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/traversal/NodeIterator.html#nextNode()">nextNode</A></B>()</CODE> <BR> Returns the next node in the set and advances the position of the <code>NodeIterator</code> in the set.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../org/w3c/dom/Node.html" title="interface in org.w3c.dom">Node</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/traversal/NodeIterator.html#previousNode()">previousNode</A></B>()</CODE> <BR> Returns the previous node in the set and moves the position of the <code>NodeIterator</code> backwards in the set.</TD> </TR> </TABLE> <P> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="getRoot()"><!-- --></A><H3> getRoot</H3> <PRE> <A HREF="../../../../org/w3c/dom/Node.html" title="interface in org.w3c.dom">Node</A> <B>getRoot</B>()</PRE> <DL> <DD>The root node of the <code>NodeIterator</code>, as specified when it was created. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getWhatToShow()"><!-- --></A><H3> getWhatToShow</H3> <PRE> int <B>getWhatToShow</B>()</PRE> <DL> <DD>This attribute determines which node types are presented via the <code>NodeIterator</code>. The available set of constants is defined in the <code>NodeFilter</code> interface. Nodes not accepted by <code>whatToShow</code> will be skipped, but their children may still be considered. Note that this skip takes precedence over the filter, if any. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getFilter()"><!-- --></A><H3> getFilter</H3> <PRE> <A HREF="../../../../org/w3c/dom/traversal/NodeFilter.html" title="interface in org.w3c.dom.traversal">NodeFilter</A> <B>getFilter</B>()</PRE> <DL> <DD>The <code>NodeFilter</code> used to screen nodes. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getExpandEntityReferences()"><!-- --></A><H3> getExpandEntityReferences</H3> <PRE> boolean <B>getExpandEntityReferences</B>()</PRE> <DL> <DD>The value of this flag determines whether the children of entity reference nodes are visible to the <code>NodeIterator</code>. If false, these children and their descendants will be rejected. Note that this rejection takes precedence over <code>whatToShow</code> and the filter. Also note that this is currently the only situation where <code>NodeIterators</code> may reject a complete subtree rather than skipping individual nodes. <br> <br> To produce a view of the document that has entity references expanded and does not expose the entity reference node itself, use the <code>whatToShow</code> flags to hide the entity reference node and set <code>expandEntityReferences</code> to true when creating the <code>NodeIterator</code>. To produce a view of the document that has entity reference nodes but no entity expansion, use the <code>whatToShow</code> flags to show the entity reference node and set <code>expandEntityReferences</code> to false. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="nextNode()"><!-- --></A><H3> nextNode</H3> <PRE> <A HREF="../../../../org/w3c/dom/Node.html" title="interface in org.w3c.dom">Node</A> <B>nextNode</B>() throws <A HREF="../../../../org/w3c/dom/DOMException.html" title="class in org.w3c.dom">DOMException</A></PRE> <DL> <DD>Returns the next node in the set and advances the position of the <code>NodeIterator</code> in the set. After a <code>NodeIterator</code> is created, the first call to <code>nextNode()</code> returns the first node in the set. <P> <DD><DL> <DT><B>Returns:</B><DD>The next <code>Node</code> in the set being iterated over, or <code>null</code> if there are no more members in that set. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../org/w3c/dom/DOMException.html" title="class in org.w3c.dom">DOMException</A></CODE> - INVALID_STATE_ERR: Raised if this method is called after the <code>detach</code> method was invoked.</DL> </DD> </DL> <HR> <A NAME="previousNode()"><!-- --></A><H3> previousNode</H3> <PRE> <A HREF="../../../../org/w3c/dom/Node.html" title="interface in org.w3c.dom">Node</A> <B>previousNode</B>() throws <A HREF="../../../../org/w3c/dom/DOMException.html" title="class in org.w3c.dom">DOMException</A></PRE> <DL> <DD>Returns the previous node in the set and moves the position of the <code>NodeIterator</code> backwards in the set. <P> <DD><DL> <DT><B>Returns:</B><DD>The previous <code>Node</code> in the set being iterated over, or <code>null</code> if there are no more members in that set. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../org/w3c/dom/DOMException.html" title="class in org.w3c.dom">DOMException</A></CODE> - INVALID_STATE_ERR: Raised if this method is called after the <code>detach</code> method was invoked.</DL> </DD> </DL> <HR> <A NAME="detach()"><!-- --></A><H3> detach</H3> <PRE> void <B>detach</B>()</PRE> <DL> <DD>Detaches the <code>NodeIterator</code> from the set which it iterated over, releasing any computational resources and placing the <code>NodeIterator</code> in the INVALID state. After <code>detach</code> has been invoked, calls to <code>nextNode</code> or <code>previousNode</code> will raise the exception INVALID_STATE_ERR. <P> <DD><DL> </DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../org/w3c/dom/traversal/NodeFilter.html" title="interface in org.w3c.dom.traversal"><B>PREV CLASS</B></A> <A HREF="../../../../org/w3c/dom/traversal/TreeWalker.html" title="interface in org.w3c.dom.traversal"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/w3c/dom/traversal/NodeIterator.html" target="_top"><B>FRAMES</B></A> <A HREF="NodeIterator.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>