This interface represents a sequence of items as defined in the XDM. More...
Public Member Functions | |
boolean | absolute (int i) throws XQException |
Moves the ZorbaXQSequence's position to the given item number in this object. | |
void | afterLast () throws XQException |
Move to the position after the last item. | |
void | beforeFirst () throws XQException |
Moves to the position before the first item. | |
void | close () throws XQException |
Closes the sequence and frees all resources associated with this sequence. | |
int | count () throws XQException |
Returns a number indicating the number of items in the sequence. | |
boolean | first () throws XQException |
Moves to the first item in the sequence. | |
String | getAtomicValue () throws XQException |
Gets the current item as a Java String. | |
boolean | getBoolean () throws XQException |
Gets the current item as a boolean. | |
byte | getByte () throws XQException |
Gets the current item as a byte. | |
double | getDouble () throws XQException |
Gets the current item as a double. | |
float | getFloat () throws XQException |
Gets the current item as a float. | |
int | getInt () throws XQException |
Gets the current item as an int. | |
XQItem | getItem () throws XQException |
Get the current item as an immutable ZorbaXQItem object. | |
XMLStreamReader | getItemAsStream () throws XQException |
Read the current item as an XMLStreamReader object. | |
String | getItemAsString (Properties prprts) throws XQException |
Serializes the current item according to the XSLT 2.0 and XQuery 1.0 serialization. | |
XQItemType | getItemType () throws XQException |
Gets the type of the item. | |
long | getLong () throws XQException |
Gets the current item as a long. | |
Node | getNode () throws XQException |
Gets the item as a DOM node. | |
URI | getNodeUri () throws XQException |
Returns the URI for this item. | |
Object | getObject () throws XQException |
Gets the current item as an Object. | |
int | getPosition () throws XQException |
Gets the current cursor position. | |
XMLStreamReader | getSequenceAsStream () throws XQException |
Read the entire sequence starting from the current position as an XMLStreamReader object. | |
String | getSequenceAsString (Properties prprts) throws XQException |
Serializes the sequence starting from the current position to a String. | |
short | getShort () throws XQException |
Gets the current item as a short. | |
boolean | instanceOf (XQItemType xqit) throws XQException |
Checks if the item "matches" an item type. | |
boolean | isAfterLast () throws XQException |
Checks if the current position is after the last item in the sequence. | |
boolean | isBeforeFirst () throws XQException |
Checks if the current position before the first item in the sequence. | |
boolean | isClosed () |
Checks if the sequence is closed. | |
boolean | isFirst () throws XQException |
Checks if the current position at the first item in the sequence. | |
boolean | isLast () throws XQException |
Checks if the current position at the last item in the sequence. | |
boolean | isOnItem () throws XQException |
Check if the sequence is positioned on an item or not. | |
boolean | isScrollable () throws XQException |
Checks if the sequence is scrollable. | |
boolean | last () throws XQException |
Moves to the last item in the sequence. | |
boolean | next () throws XQException |
Moves to the next item in the sequence. | |
boolean | previous () throws XQException |
Moves to the previous item in the sequence. | |
boolean | relative (int i) throws XQException |
Moves the cursor a relative number of items. | |
void | writeItem (OutputStream out, Properties prprts) throws XQException |
Serializes the current item to a Writer. | |
void | writeItem (Writer writer, Properties prprts) throws XQException |
Serializes the current item to a Writer. | |
void | writeItemToResult (Result result) throws XQException |
Writes the current item to a Result. | |
void | writeItemToSAX (ContentHandler ch) throws XQException |
Writes the current item to a SAX handler. | |
void | writeSequence (OutputStream out, Properties prprts) throws XQException |
Serializes the sequence starting from the current position to an OutputStream. | |
void | writeSequence (Writer writer, Properties prprts) throws XQException |
Serializes the sequence starting from the current position to a Writer. | |
void | writeSequenceToResult (Result result) throws XQException |
Writes the entire sequence starting from the current position to a Result. | |
void | writeSequenceToSAX (ContentHandler ch) throws XQException |
Writes the entire sequence starting from the current position to a SAX handler. | |
ZorbaXQSequence (javax.xml.xquery.XQSequence sequence) throws XQException | |
ZorbaXQSequence (java.util.Iterator iterator) | |
ZorbaXQSequence (org.zorbaxquery.api.Iterator iterator) | |
ZorbaXQSequence (org.zorbaxquery.api.Item item) |
Protected Member Functions | |
ItemSequence | getItemSequence () throws XQException |
ZorbaXQSequence (ItemSequence seq) |
This interface represents a sequence of items as defined in the XDM.
The sequence may be materialized or non-materialized.
The next method is useful to position the ZorbaXQSequence over the next item in the sequence. If the scrollability is XQConstants.SCROLLTYPE_SCROLLABLE, then the previous method can be called to move backwards. In the case of a forward only sequence, the get methods may be only called once per item. To perform multiple gets on an item, extract the item first from the sequence using the getItem method and then operate on the ZorbaXQItem object. @code {.java} XQPreparedExpression expr = conn.prepareExpression("for $i .."); ZorbaXQSequence result = expr.executeQuery(); // create the ItemTypes for string and integer XQItemType strType = conn.createAtomicType(XQItemType.XQBASETYPE_STRING); XQItemType intType = conn.createAtomicType(XQItemType.XQBASETYPE_INT); // positioned before the first item while (result.next()) { XQItemType type = result.getItemType(); // If string, then get the string value out if (type.equals(strType)) String str = result.getAtomicValue(); else if (type.equals(intType)) // if it is an integer.. int intval = result.getInt(); ... } \endcode In a sequence, the cursor may be positioned on an item, after the last item or before the first item. The getPosition method returns the current position number. A value of 0 indicates that it is positioned before the first item, a value of count() + 1 indicates that it is positioned after the last item, and any other value indicates that it is positioned on the item at that position. For example, a position value of 1 indicates that it is positioned on the item at position 1. The isOnItem method may be used to find out if the cursor is positioned on the item. When the cursor is positioned on an item, the next method call will move the cursor to be on the next item. See also: Section 12 Serialization, XQuery API for Java (XQJ) 1.0, which describes some general information applicable to various XQJ serialization methods.
Definition at line 77 of file ZorbaXQSequence.java.
|
inline |
Definition at line 87 of file ZorbaXQSequence.java.
|
inline |
Definition at line 106 of file ZorbaXQSequence.java.
|
inline |
Definition at line 116 of file ZorbaXQSequence.java.
|
inline |
Definition at line 127 of file ZorbaXQSequence.java.
|
inlineprotected |
Definition at line 133 of file ZorbaXQSequence.java.
|
inline |
Moves the ZorbaXQSequence's position to the given item number in this object.
If the item number is positive, the ZorbaXQSequence moves to the given item number with respect to the beginning of the ZorbaXQSequence. The first item is item 1, the second is item 2, and so on.
If the given item number is negative, the ZorbaXQSequence positions itself on an absolute item position with respect to the end of the sequence.
For example, calling the method absolute(-1) positions the ZorbaXQSequence on the last item; calling the method absolute(-2) moves the ZorbaXQSequence to the next-to-last item, and so on. absolute(0) will position the sequence before the first item.
An attempt to position the sequence beyond the first/last item set leaves the current position to be before the first item or after the last item.
Calling this method on an empty sequence will return false.
i | - the item position to jump to |
XQException | - if (1) the sequence is forward only, or (2) the sequence is in a closed state |
Definition at line 171 of file ZorbaXQSequence.java.
|
inline |
Move to the position after the last item.
XQException | - if (1) the sequence is forward only, or (2) the sequence is in a closed state |
Definition at line 198 of file ZorbaXQSequence.java.
|
inline |
Moves to the position before the first item.
XQException | - if (1) the sequence is forward only, or (2) the sequence is in a closed state |
Definition at line 208 of file ZorbaXQSequence.java.
|
inline |
Closes the sequence and frees all resources associated with this sequence.
Closing an ZorbaXQSequence object also implicitly closes all ZorbaXQItem objects obtained from it. All methods other than the isClosed or close method will raise exceptions when invoked after closing the sequence. Calling close on an ZorbaXQSequence object that is already closed has no effect.
XQException | - if there are errors during closing of the sequence |
Definition at line 220 of file ZorbaXQSequence.java.
|
inline |
Returns a number indicating the number of items in the sequence.
XQException | - if (1) the sequence is forward-only, or (2) the sequence is closed |
Definition at line 245 of file ZorbaXQSequence.java.
|
inline |
Moves to the first item in the sequence.
The method returns true, if it was able to move to the first item in the sequence false, otherwise. Calling this method on an empty sequence will return false.
XQException | - if (1) the sequence is forward only, or (2) the sequence is in a closed state |
Definition at line 296 of file ZorbaXQSequence.java.
|
inline |
Gets the current item as a Java String.
The current item must be an atomic value. This function casts the current item to an xs:string value according to the casting rules defined in 17.1.2 Casting to xs:string and xs:untypedAtomic, XQuery 1.0 and XPath 2.0 Functions and Operators, and then returns the value as a Java String.
XQException | - if (1) there are errors accessing the item's value, (2) the item is not an atomic value, (3) there is an error when casting the item to a string representation, (4) the underlying sequence or item is in a closed state, or (5) in the case of forward only sequences, a get or write method was already invoked on the current item |
Definition at line 691 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem().
|
inline |
Gets the current item as a boolean.
The current item must be an atomic value of type xs:boolean or a subtype.
XQException | - if (1) the conversion of the current item to a boolean fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item |
Definition at line 613 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem().
|
inline |
Gets the current item as a byte.
The current item must be an atomic value of type xs:decimal or a subtype, and its value must be in the value space of byte.
XQException | - if (1) the conversion of the current item to a byte fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item |
Definition at line 626 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem().
|
inline |
Gets the current item as a double.
The current item must be an atomic value of type xs:double or a subtype.
XQException | - if (1) the conversion of the current item to a double fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item |
Definition at line 639 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem().
|
inline |
Gets the current item as a float.
The current item must be an atomic value of type xs:float or a subtype.
XQException | - if (1) the conversion of the current item to a float fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item |
Definition at line 652 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem().
|
inline |
Gets the current item as an int.
The current item must be an atomic value of type xs:decimal or a subtype, and its value must be in the value space of int.
XQException | - if (1) the conversion of the current item to a int fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item |
Definition at line 665 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem().
|
inline |
Get the current item as an immutable ZorbaXQItem object.
In case of an XQResultSequence, the item is an ZorbaXQResultItem. In the case of forward only sequences, this method or any other get or write method may only be called once on the curent item.
The ZorbaXQItem object is dependent on the sequence from which it was created and is only valid for the duration of ZorbaXQSequence lifetime. Thus, the ZorbaXQSequence is closed, this ZorbaXQItem object will be implicitly closed and it can no longer be used.
XQException | - if (1) there are errors retrieving the item, or (2) in the case of a forward only sequence, a get or write method has already been invoked on the current item. |
Definition at line 316 of file ZorbaXQSequence.java.
Referenced by org.zorbaxquery.api.xqj.ZorbaXQSequence.getAtomicValue(), org.zorbaxquery.api.xqj.ZorbaXQSequence.getBoolean(), org.zorbaxquery.api.xqj.ZorbaXQSequence.getByte(), org.zorbaxquery.api.xqj.ZorbaXQSequence.getDouble(), org.zorbaxquery.api.xqj.ZorbaXQSequence.getFloat(), org.zorbaxquery.api.xqj.ZorbaXQSequence.getInt(), org.zorbaxquery.api.xqj.ZorbaXQSequence.getItemAsStream(), org.zorbaxquery.api.xqj.ZorbaXQSequence.getItemAsString(), org.zorbaxquery.api.xqj.ZorbaXQSequence.getItemType(), org.zorbaxquery.api.xqj.ZorbaXQSequence.getLong(), org.zorbaxquery.api.xqj.ZorbaXQSequence.getNode(), org.zorbaxquery.api.xqj.ZorbaXQSequence.getNodeUri(), org.zorbaxquery.api.xqj.ZorbaXQSequence.getObject(), org.zorbaxquery.api.xqj.ZorbaXQSequence.getShort(), org.zorbaxquery.api.xqj.ZorbaXQSequence.instanceOf(), org.zorbaxquery.api.xqj.ZorbaXQSequence.writeItem(), org.zorbaxquery.api.xqj.ZorbaXQSequence.writeItemToResult(), org.zorbaxquery.api.xqj.ZorbaXQSequence.writeItemToSAX(), org.zorbaxquery.api.xqj.ZorbaXQSequence.writeSequence(), org.zorbaxquery.api.xqj.ZorbaXQSequence.writeSequenceToResult(), and org.zorbaxquery.api.xqj.ZorbaXQSequence.writeSequenceToSAX().
|
inline |
Read the current item as an XMLStreamReader object.
Read the current item as an XMLStreamReader object, as described in Section 12.1 Serializing an XDM instance into a StAX event stream (XMLStreamReader), XQuery API for Java (XQJ) 1.0. Note that the serialization process might fail, in which case a XQException is thrown. While the stream is being read, the application MUST NOT do any other concurrent operations on the underlying item or sequence. The operation on the stream is undefined if the underlying sequence is repositioned or the state of the underlying item or sequence is changed by concurrent operations.
XQException | - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (4) in case of an error during serialization of the current item into a StAX event stream as defined in Section 12.1 Serializing an XDM instance into a StAX event stream (XMLStreamReader), XQuery API for Java (XQJ) 1.0 |
Definition at line 757 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem().
|
inline |
Serializes the current item according to the XSLT 2.0 and XQuery 1.0 serialization.
Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information.
prprts | - specifies the serialization parameters, null is considered equivalent to an empty Properties object |
XQException | - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (4) if there are errors during serialization |
Definition at line 771 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem().
|
inlineprotected |
Definition at line 146 of file ZorbaXQSequence.java.
|
inline |
Gets the type of the item.
On a forward only sequence this method can be called independent of any other get or write method. It will not raise an error if such method has been called already, nor will it affect subsequent invocations of any other get or write method.
XQException | - if (1) there are errors accessing the type of the item, or (2) the underlying sequence or item is in a closed state |
Definition at line 678 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem().
|
inline |
Gets the current item as a long.
The current item must be an atomic value of type xs:decimal or a subtype, and its value must be in the value space of long.
XQException | - if (1) the conversion of the current item to a long fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item |
Definition at line 704 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem().
|
inline |
Gets the item as a DOM node.
The current item must be a node. The type of the returned DOM node is governed by Table 7 - XQuery Node Types and Corresponding Java Object Types XQuery API for Java (XQJ) 1.0 The instance of the returned node is implementation dependent. The node may be a reference or a copy of the internal state of the item. It is advisable to make a copy of the node if the application plans to modify it.
XQException | - if (1) if there are errors accessing the current item, (2) the current item is not a node, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item |
Definition at line 717 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem().
|
inline |
Returns the URI for this item.
If the item is a document node, then this method returns the absolute URI of the resource from which the document node was constructed. If the document URI is not available, then the empty string is returned. If the document URI is available, the returned value is the same as if fn:document-uri were evaluated on this document node. If the item is of a node kind other than document node, then the returned URI is implementation-defined. On a forward only sequence this method can be called independent of any other get or write method. It will not raise an error if such method has been called already, nor will it affect subsequent invocations of any other get or write method on the current item.
XQException | - if (1) if there are errors accessing the current item, (2) the current item is not a node, (3) if the underlying sequence or item is in a closed state |
Definition at line 731 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem().
|
inline |
Gets the current item as an Object.
The data type of the returned object will be the Java Object type as specified in 14.4 Mapping an XQuery Atomic Value to a Java Object Type and 14.5 Mapping an XQuery Node to a Java Object Type, XQuery API for Java (XQJ) 1.0.
XQException | - if (1) if there are errors accessing the current item, (2) if the underlying sequence or item is in a closed state, or (3) in the case of forward only sequences, a get or write method was already invoked on the current item |
Definition at line 744 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem().
|
inline |
Gets the current cursor position.
0 indicates that the position is before the first item and count() + 1 indicates position after the last item. A specific position indicates that the cursor is positioned on the item at that position. Use the isOnItem method to verify if the cursor is positioned on the item.
Calling this method on an empty sequence will return 0.
XQException | - if (1) the sequence is forward-only, or (2) the sequence is closed |
Definition at line 259 of file ZorbaXQSequence.java.
|
inline |
Read the entire sequence starting from the current position as an XMLStreamReader object.
Read the entire sequence starting from the current position as an XMLStreamReader object, as described in Section 12.1 Serializing an XDM instance into a StAX event stream (XMLStreamReader), XQuery API for Java (XQJ) 1.0. Note that the serialization process might fail, in which case a XQException is thrown. While the stream is being read, the application MUST NOT do any other concurrent operations on the sequence. The operation on the stream is undefined if the underlying sequence position or state is changed by concurrent operations. After all items are written to the stream, the current position of the cursor is set to point after the last item. Also, in the case of forward only sequences, this method may only be called if the current item has not yet been read through any of the get or write methods.
XQException | - if (1) there are errors accessing any of the items in the sequence, (2) the sequence is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (4) in case of an error during serialization of the sequence into a StAX event stream as defined in Section 12.1 Serializing an XDM instance into a StAX event stream (XMLStreamReader), XQuery API for Java (XQJ) 1.0 |
Definition at line 330 of file ZorbaXQSequence.java.
|
inline |
Serializes the sequence starting from the current position to a String.
Serializes the sequence starting from the current position to a String according to the XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information. Reading the sequence during the serialization process performs implicit next operations to read the items. After all items are written to the stream, the current position of the cursor is set to point after the last item. Also, in the case of forward only sequences, this method may only be called if the current item has not yet been read through any of the get or write methods.
prprts | - specifies the serialization parameters, null is considered equivalent to an empty Properties object |
XQException | - if (1) there are errors accessing the items in the sequence, (2) there are errors during serialization, (3) the sequence is in a closed state, or (4) in the case of a forward only sequence, a get or write method has already been invoked on the current item |
Definition at line 357 of file ZorbaXQSequence.java.
|
inline |
Gets the current item as a short.
The current item must be an atomic value of type xs:decimal or a subtype, and its value must be in the value space of short.
XQException | - if (1) the conversion of the current item to a short fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item |
Definition at line 784 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem().
|
inline |
Checks if the item "matches" an item type.
Checks if the item "matches" an item type, as defined in 2.5.4.2 Matching an Item Type and an Item, XQuery 1.0: An XML Query Language. You can use this method to first check the type of the result before calling the specific get methods.
Example -
xqit | - item type to match |
XQException | - if (1) there are errors accessing the item's type, (2) if the underlying sequence or item is in a closed state, (3) if the implementation is unable to determine the schema definition of a user defined schema type, or (4) the type parameter is null |
Definition at line 818 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem().
|
inline |
Checks if the current position is after the last item in the sequence.
Calling this method on an empty sequence will return false.
XQException | - if (1) the sequence is forward only, or (2) the sequence is in a closed state |
Definition at line 375 of file ZorbaXQSequence.java.
|
inline |
Checks if the current position before the first item in the sequence.
Calling this method on an empty sequence will return false.
XQException | - if (1) the sequence is forward only, or (2) the sequence is in a closed state |
Definition at line 392 of file ZorbaXQSequence.java.
|
inline |
Checks if the sequence is closed.
Definition at line 235 of file ZorbaXQSequence.java.
|
inline |
Checks if the current position at the first item in the sequence.
Calling this method on an empty sequence will return false.
XQException | - if (1) the sequence is forward only, or (2) the sequence is in a closed state |
Definition at line 409 of file ZorbaXQSequence.java.
|
inline |
Checks if the current position at the last item in the sequence.
Calling this method on an empty sequence will return false.
XQException | - if (1) the sequence is forward only, or (2) the sequence is in a closed state |
Definition at line 426 of file ZorbaXQSequence.java.
|
inline |
Check if the sequence is positioned on an item or not.
Calling this method on an empty sequence will return false.
XQException | - if the sequence is in a closed state |
Definition at line 272 of file ZorbaXQSequence.java.
Referenced by org.zorbaxquery.api.xqj.ZorbaXQSequence.writeSequence(), org.zorbaxquery.api.xqj.ZorbaXQSequence.writeSequenceToResult(), and org.zorbaxquery.api.xqj.ZorbaXQSequence.writeSequenceToSAX().
|
inline |
Checks if the sequence is scrollable.
XQException | - if the sequence is in a closed state |
Definition at line 283 of file ZorbaXQSequence.java.
|
inline |
Moves to the last item in the sequence.
This method returns true, if it was able to move to the last item in the sequence false, otherwise. Calling this method on an empty sequence will return false.
XQException | - if (1) the sequence is forward only, or (2) the sequence is in a closed state |
Definition at line 443 of file ZorbaXQSequence.java.
|
inline |
Moves to the next item in the sequence.
Calling this method on an empty sequence will return false.
XQException | - if the sequence is in a closed state |
Definition at line 461 of file ZorbaXQSequence.java.
Referenced by org.zorbaxquery.api.xqj.ZorbaXQSequence.writeSequence(), org.zorbaxquery.api.xqj.ZorbaXQSequence.writeSequenceToResult(), and org.zorbaxquery.api.xqj.ZorbaXQSequence.writeSequenceToSAX().
|
inline |
Moves to the previous item in the sequence.
Calling this method on an empty sequence will return false.
XQException | - if (1) the sequence is forward only, or (2) the sequence is in a closed state. |
Definition at line 479 of file ZorbaXQSequence.java.
|
inline |
Moves the cursor a relative number of items.
Moves the cursor a relative number of items, either positive or negative. Attempting to move beyond the first/last item in the sequence positions the sequence before/after the the first/last item. Calling relative(0) is valid, but does not change the cursor position. Note: Calling the method relative(1) is identical to calling the method next and calling the method relative(-1) is identical to calling the method previous(). Calling this method on an empty sequence will return false.
i | - the item position to jump to |
XQException | - if (1) the sequence is forward only, or (2) the sequence is in a closed state. |
Definition at line 499 of file ZorbaXQSequence.java.
|
inline |
Serializes the current item to a Writer.
Serializes the current item to a Writer according to XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information.
out | - the output stream into which the current item is to be serialized |
prprts | - specifies the serialization parameters, null is considered equivalent to an empty Properties object |
XQException | - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) if there are errors during serialization, or (5) the os parameter is null |
Definition at line 833 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem().
|
inline |
Serializes the current item to a Writer.
Serializes the current item to a Writer according to XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information.
Warning: When outputting to a Writer, make sure the writer's encoding matches the encoding parameter if specified as a property or the default encoding.
writer | - the output stream into which the current item is to be serialized |
prprts | - specifies the serialization parameters, null is considered equivalent to an empty Properties object |
XQException | - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) if there are errors during serialization, or (5) the os parameter is null |
Definition at line 849 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem().
|
inline |
Writes the current item to a Result.
First the item is normalized as described in XSLT 2.0 and XQuery 1.0 serialization. Subsequently it is serialized to the Result object. Note that the normalization process can fail, in which case an XQException is thrown. An XQJ implementation must at least support the following implementations:
result | - the result object into which the item is to be serialized |
XQException | - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) in case of an error while serializing the current item into the Result object, or (5) the result parameter is null |
Definition at line 881 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem().
|
inline |
Writes the current item to a SAX handler.
Writes the current item to a SAX handler, as described in in Section 12.2 Serializing an XDM instance into a SAX event stream, XQuery API for Java (XQJ) 1.0. Note that the serialization process might fail, in which case a XQException is thrown. The specified org.xml.sax.ContentHandler can optionally implement the org.xml.sax.LexicalHandler interface. An implementation must check if the specified ContentHandler implements LexicalHandler. If the handler is a LexicalHandler comment nodes are reported, otherwise they will be silently ignored.
ch | - the SAX content handler, optionally a lexical handler |
XQException | - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) in case of an error while serializing the XDM instance into a SAX event stream, or (5) the saxhdlr parameter is null |
Definition at line 863 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem().
|
inline |
Serializes the sequence starting from the current position to an OutputStream.
Serializes the sequence starting from the current position to an OutputStream according to the XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information. Reading the sequence during the serialization process performs implicit next operations to read the items. After all items are written to the stream, the current position of the cursor is set to point after the last item. Also, in the case of forward only sequences, this method may only be called if the current item has not yet been read through any of the get or write methods.
out | - the output stream into which the sequence is to be serialized |
prprts | - specifies the serialization parameters, null is considered equivalent to an empty Properties object |
XQException | - if (1) there are errors accessing the items in the sequence, (2) there are errors during serialization, (3) the sequence is in a closed state, (4) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (5) the os parameter is null |
Definition at line 524 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem(), org.zorbaxquery.api.xqj.ZorbaXQSequence.isOnItem(), and org.zorbaxquery.api.xqj.ZorbaXQSequence.next().
|
inline |
Serializes the sequence starting from the current position to a Writer.
Serializes the sequence starting from the current position to a Writer according to the XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information.
Warning: When outputting to a Writer, make sure the writer's encoding matches the encoding parameter if specified as a property or the default encoding.
Reading the sequence during the serialization process performs implicit next operations to read the items. After all items are written to the stream, the current position of the cursor is set to point after the last item. Also, in the case of forward only sequences, this method may only be called if the current item has not yet been read through any of the get or write methods.
writer | - the writer object into which the sequence is to be serialized |
prprts | - specifies the serialization parameters, null is considered equivalent to an empty Properties object |
XQException | - if (1) there are errors accessing the items in the sequence, (2) there are errors during serialization, (3) the sequence is in a closed state, (4) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (5) the ow parameter is null |
Definition at line 549 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem(), org.zorbaxquery.api.xqj.ZorbaXQSequence.isOnItem(), and org.zorbaxquery.api.xqj.ZorbaXQSequence.next().
|
inline |
Writes the entire sequence starting from the current position to a Result.
First the sequence is normalized as described in XSLT 2.0 and XQuery 1.0 serialization. Subsequently it is serialized to the Result object. Note that the normalization process can fail, in which case an XQException is thrown. An XQJ implementation must at least support the following implementations:
result | - the result object into which the sequence is to be serialized |
XQException | - if (1) there are errors accessing any of the items in the sequence, (2) the sequence is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) in case of an error while serializing the sequence into the Result object, or (5) the result parameter is null |
Definition at line 593 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem(), org.zorbaxquery.api.xqj.ZorbaXQSequence.isOnItem(), and org.zorbaxquery.api.xqj.ZorbaXQSequence.next().
|
inline |
Writes the entire sequence starting from the current position to a SAX handler.
Writes the entire sequence starting from the current position to a SAX handler, as described in Section 12.2 Serializing an XDM instance into a SAX event stream, XQuery API for Java (XQJ) 1.0. Note that the serialization process might fail, in which case a XQException is thrown. After all items are written to the stream, the current position of the cursor is set to point after the last item. Also, in the case of forward only sequences, this method may only be called if the current item has not yet been read through any of the get or write methods. The specified org.xml.sax.ContentHandler can optionally implement the org.xml.sax.LexicalHandler interface. An implementation must check if the specified ContentHandler implements LexicalHandler. If the handler is a LexicalHandler comment nodes are reported, otherwise they will be silently ignored.
ch | - the SAX content handler, optionally a lexical handler |
XQException | - if (1) there are errors accessing any of the items in the sequence, (2) the sequence is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) in case of an error during serializing the XDM instance into a SAX event stream, or (5) the saxhdlr parameter is null |
Definition at line 569 of file ZorbaXQSequence.java.
References org.zorbaxquery.api.xqj.ZorbaXQSequence.getItem(), org.zorbaxquery.api.xqj.ZorbaXQSequence.isOnItem(), and org.zorbaxquery.api.xqj.ZorbaXQSequence.next().