Qizx fe-4.4p2 API

com.qizx.api
Interface Item

All Known Subinterfaces:
ItemSequence, Node

public interface Item

An Item of a Sequence returned by the evaluation of an XQuery Expression.


Method Summary
 void export(XMLPushStream writer)
          Streaming export of a Node in "push" mode.
 XMLPullStream exportNode()
          Streaming export of a Node, in "pull" mode.
 boolean getBoolean()
          Gets the item's boolean value.
 BigDecimal getDecimal()
          Gets the item's decimal value.
 double getDouble()
          Gets the item's double value.
 float getFloat()
          Gets the item's float value.
 long getInteger()
          Gets the item's integer value.
 Node getNode()
          Gets the item's Node value.
 Object getObject()
          Converts the item value to a Java object, according to its actual type.
 QName getQName()
          Gets the item's QName value.
 String getString()
          Gets the item's String value.
 ItemType getType()
          Returns the XQuery type of the item.
 boolean isNode()
          Tests whether the item is a Node.
 

Method Detail

getType

ItemType getType()
                 throws EvaluationException
Returns the XQuery type of the item.

Returns:
XQuery type of the item
Throws:
EvaluationException - if access to the item is not possible

getBoolean

boolean getBoolean()
                   throws EvaluationException
Gets the item's boolean value.

Returns:
the boolean value. If the item is a node, an attempt to convert its string value is made.
Throws:
EvaluationException - if the item cannot be accessed or is not boolean and not convertible

getFloat

float getFloat()
               throws EvaluationException
Gets the item's float value.

Returns:
the float value. If the item is a node, an attempt to convert its string value is made.
Throws:
EvaluationException - if the item cannot be accessed or is not float and not convertible

getDouble

double getDouble()
                 throws EvaluationException
Gets the item's double value.

Returns:
the double value. If the item is a node, an attempt to convert its string value is made.
Throws:
EvaluationException - if the item cannot be accessed or is not double and not convertible

getInteger

long getInteger()
                throws EvaluationException
Gets the item's integer value.

Returns:
the long integer value. If the item is a node, an attempt to convert its string value is made.
Throws:
EvaluationException - if the item cannot be accessed or is not integer and not convertible

getDecimal

BigDecimal getDecimal()
                      throws EvaluationException
Gets the item's decimal value.

Returns:
the decimal value as a BigDecimal. If the item is a node, an attempt to convert its string value is made.
Throws:
EvaluationException - if the item cannot be accessed or is not decimal and not convertible

getString

String getString()
                 throws EvaluationException
Gets the item's String value.

Returns:
the string value
Throws:
EvaluationException - if the item cannot be accessed

getQName

QName getQName()
               throws EvaluationException
Gets the item's QName value.

Returns:
the QName value
Throws:
EvaluationException - if the item cannot be accessed or is not a QName

isNode

boolean isNode()
Tests whether the item is a Node.

Returns:
true if the item is an accessible node

getNode

Node getNode()
             throws EvaluationException
Gets the item's Node value.

Returns:
the item as a Node
Throws:
EvaluationException - if the item cannot be accessed or is not a Node

exportNode

XMLPullStream exportNode()
                         throws EvaluationException
Streaming export of a Node, in "pull" mode.

Returns:
a XMLPullStream that delivers the contents of the node item.
Throws:
EvaluationException - if the item cannot be accessed or is not a node

export

void export(XMLPushStream writer)
            throws QizxException
Streaming export of a Node in "push" mode. Can use for example XMLSerializer, PushStreamToSAX, PushStreamToDOM, or a custom adapter to any other representation.

Parameters:
writer - a push stream output
Throws:
QizxException - if not a node, or not accessible, or a DataModelException is thrown by the writer.

getObject

Object getObject()
                 throws QizxException
Converts the item value to a Java object, according to its actual type. Nodes are converted to w3c DOM nodes.

The precise mapping of XQuery types to Java types is described in the documentation of Java Binding.

Returns:
the item converted into a Java object
Throws:
QizxException - if the item cannot be accessed or if the conversion fails

© 2010 Axyana Software