<!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 Fri Dec 09 20:48:46 GMT 2011 --> <TITLE> XQResultItem </TITLE> <META NAME="date" CONTENT="2011-12-09"> <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="XQResultItem"; } } </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="../../../javax/xml/xquery/XQQueryException.html" title="class in javax.xml.xquery"><B>PREV CLASS</B></A> <A HREF="../../../javax/xml/xquery/XQResultSequence.html" title="interface in javax.xml.xquery"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?javax/xml/xquery/XQResultItem.html" target="_top"><B>FRAMES</B></A> <A HREF="XQResultItem.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"> javax.xml.xquery</FONT> <BR> Interface XQResultItem</H2> <DL> <DT><B>All Superinterfaces:</B> <DD><A HREF="../../../javax/xml/xquery/XQItem.html" title="interface in javax.xml.xquery">XQItem</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html" title="interface in javax.xml.xquery">XQItemAccessor</A></DD> </DL> <DL> <DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../net/sf/saxon/xqj/SaxonXQItem.html" title="class in net.sf.saxon.xqj">SaxonXQItem</A></DD> </DL> <HR> <DL> <DT><PRE>public interface <B>XQResultItem</B><DT>extends <A HREF="../../../javax/xml/xquery/XQItem.html" title="interface in javax.xml.xquery">XQItem</A></DL> </PRE> <P> This interface represents an immutable item object obtained from an <code>XQResultSequence</code> using the <code>getItem</code> method. <p> A forward only result sequence does not support calling the getter methods multiple times on the same item. To work around this case, the <code>getItem</code> method can be used to obtain a result item and then getter methods may be called multiple times on this item. <p> The <code>XQResultItem</code> object is dependent on the connection, expression and the sequence from which it was created and is only valid for the duration of those objects. Thus, if any one of those objects is closed, this <code>XQResultItem</code> object will be implicitly closed, and it can no longer be used. Similarly re-executing the expression also implicitly closes the associated result sequences, which in turn implicitly closes this result item. <p> An XQJ driver is not required to provide finalizer methods for the connection and other objects. Hence it is strongly recommended that users call close method explicitly to free any resources. It is also recommended that they do so under a final block to ensure that the object is closed even when there are exceptions. Not closing this object implicitly or explicitly might result in serious memory leaks.<p> Example - <pre> XQPreparedExpression expr = conn.prepareExpression("for $i .."); XQResultSequence result = expr.executeQuery(); // posititioned before the first item while (result.next()) { XQResultItem item = result.getItem(); // perform multiple gets on this item // get DOM org.w3.dom.Node node = item.getNode(); // get SAX item.writeItemToSAX(saxHandler); item.close(); // good practice. Item will get implicitly closed // when the expression, connection or sequence is closed. } result.close(); // explicitly close the result sequence </pre> <P> <P> <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> <A HREF="../../../javax/xml/xquery/XQConnection.html" title="interface in javax.xml.xquery">XQConnection</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/XQResultItem.html#getConnection()">getConnection</A></B>()</CODE> <BR> Gets the XQuery connection associated with this result item</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_javax.xml.xquery.XQItem"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from interface javax.xml.xquery.<A HREF="../../../javax/xml/xquery/XQItem.html" title="interface in javax.xml.xquery">XQItem</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../javax/xml/xquery/XQItem.html#close()">close</A>, <A HREF="../../../javax/xml/xquery/XQItem.html#isClosed()">isClosed</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_javax.xml.xquery.XQItemAccessor"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from interface javax.xml.xquery.<A HREF="../../../javax/xml/xquery/XQItemAccessor.html" title="interface in javax.xml.xquery">XQItemAccessor</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getAtomicValue()">getAtomicValue</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getBoolean()">getBoolean</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getByte()">getByte</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getDouble()">getDouble</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getFloat()">getFloat</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getInt()">getInt</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getItemAsStream()">getItemAsStream</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getItemAsString(java.util.Properties)">getItemAsString</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getItemType()">getItemType</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getLong()">getLong</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getNode()">getNode</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getNodeUri()">getNodeUri</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getObject()">getObject</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getShort()">getShort</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#instanceOf(javax.xml.xquery.XQItemType)">instanceOf</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#writeItem(java.io.OutputStream, java.util.Properties)">writeItem</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#writeItem(java.io.Writer, java.util.Properties)">writeItem</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#writeItemToResult(javax.xml.transform.Result)">writeItemToResult</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#writeItemToSAX(org.xml.sax.ContentHandler)">writeItemToSAX</A></CODE></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="getConnection()"><!-- --></A><H3> getConnection</H3> <PRE> <A HREF="../../../javax/xml/xquery/XQConnection.html" title="interface in javax.xml.xquery">XQConnection</A> <B>getConnection</B>() throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE> <DL> <DD>Gets the XQuery connection associated with this result item <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the connection associated with this result item <DT><B>Throws:</B> <DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if the result item is in a closed state</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="../../../javax/xml/xquery/XQQueryException.html" title="class in javax.xml.xquery"><B>PREV CLASS</B></A> <A HREF="../../../javax/xml/xquery/XQResultSequence.html" title="interface in javax.xml.xquery"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?javax/xml/xquery/XQResultItem.html" target="_top"><B>FRAMES</B></A> <A HREF="XQResultItem.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> Copyright (c) 2004-2011 Saxonica Limited. All rights reserved. </BODY> </HTML>