|
Qizx/db 2.1 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Creates Items and related resources (ItemTypes and QNames).
| Method Summary | |
ItemSequence |
copySequence(ItemSequence sequence)
Creates a copy of the specified Sequence. |
Item |
createItem(boolean value)
Creates an Item of type xs:boolean. |
Item |
createItem(double value)
Creates an Item of type xs:double. |
Item |
createItem(float value)
Creates an Item of type xs:float. |
Item |
createItem(InputSource source)
Creates a Document Node item by parsing a document. |
Item |
createItem(long value,
ItemType type)
Creates an Item of type xs:integer, or one of its sub-types. |
Item |
createItem(Object value,
ItemType type)
Creates an item from a given object according to the general Java to XQuery type mapping, also used in the Java Binding extension. |
Item |
createItem(XMLPullStream source)
Creates a Node item by reading a XML stream. |
ItemSequence |
createSequence(Object object,
SequenceType type)
Creates a sequence from a Java object. |
QName |
getQName(String localName)
Returns a QName without namespace and without prefix. |
QName |
getQName(String localName,
String namespaceURI)
Returns a QName without prefix. |
QName |
getQName(String localName,
String namespaceURI,
String prefix)
Returns a QName with prefix. |
ItemType |
getType(String name)
Returns a predefined item Type from its name. |
| Method Detail |
public QName getQName(String localName)
localName - a name without colon.
public QName getQName(String localName,
String namespaceURI)
localName - a name without colon.namespaceURI - namespace URI
public QName getQName(String localName,
String namespaceURI,
String prefix)
localName - a simple name without colonnamespaceURI - namespace URIprefix - optional prefix, can be null.
public ItemType getType(String name)
The name may be a short name without the "xs:" prefix. For example getType("xs:double") and getType("double") both return a representation of the XQuery type xs:double.
name - type name. Predefined short names: ENTITY, ID,
IDREF, NCName, NMTOKEN, NOTATION, Name, QName, anyAtomicType,
anySimpleType (item), anyURI, base64Binary, boolean, byte, date,
dateTime, dayTimeDuration, decimal, double, duration, empty,
float, gDay, gMonth, gMonthDay, gYear, gYearMonth, hexBinary,
int, integer, language, long, negativeInteger, node,
nonNegativeInteger, nonPositiveInteger, normalizedString,
positiveInteger, short, string, time, token, unsignedByte,
unsignedInt, unsignedLong, unsignedShort, untypedAtomic,
yearMonthDuration
public Item createItem(Object value,
ItemType type)
throws EvaluationException
value - any object that can be converted to a XQuery Item.type - type of the created item. Can be null. If it is null, the
type will be the "natural type" of the actual object (see the
Java to XQuery Mapping specification in the Qizx documentation).
EvaluationException - if the conversion was not possible.public Item createItem(boolean value)
value - a boolean value
public Item createItem(double value)
value - a double value
public Item createItem(float value)
value - a float value
public Item createItem(long value,
ItemType type)
throws EvaluationException
value - any longtype - desired item type: must be null or xs:integer or a subtype
of xs:integer.
EvaluationException - if the type is not a subtype of xs:integer.
public Item createItem(InputSource source)
throws EvaluationException,
IOException
source - a SAX input source
EvaluationException - wraps a parsing exception
IOException - if the source cannot be read
public Item createItem(XMLPullStream source)
throws EvaluationException
The resulting item can be any kind of node, depending on the XML event(s) encountered.
The source will be read until a complete Node is formed, but no further. Therefore it is possible to call repeatedly this method on the same source, provided it is correctly positioned initially.
source - a XML pull stream
EvaluationException
public ItemSequence copySequence(ItemSequence sequence)
throws EvaluationException
sequence - an input sequence of items. The position is left
untouched
EvaluationException - if the enumeration of the input sequence
caused an error
public ItemSequence createSequence(Object object,
SequenceType type)
throws EvaluationException
createItem(Object, ItemType),
using the specified type. For example if the type argument is
xs:double*, the method will attempt to convert each item to a double.
object - Java object to converttype - optional type hint
EvaluationException
|
© 2008 Axyana Software | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||