|
Qizx fe-4.4p2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ItemFactory
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. |
ItemType |
getNodeType(int nodeKind,
QName name)
Returns a node Type from a node-kind and an optional element or attribute name. |
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 |
---|
QName getQName(String localName)
localName
- a name without colon.
QName getQName(String localName, String namespaceURI)
localName
- a name without colon.namespaceURI
- namespace URI
QName getQName(String localName, String namespaceURI, String prefix)
localName
- a simple name without colonnamespaceURI
- namespace URIprefix
- optional prefix, can be null.
ItemType getType(String name)
getNodeType(int, QName)
.
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
ItemType getNodeType(int nodeKind, QName name)
nodeKind
- the node kind code: possible values are Node.ELEMENT,
Node.ATTRIBUTE etc.
To get the type node(), use ItemType.NODE_TYPE as argument.
name
- optional name restricting the node type. For example
factory.getNodeType(Node.ELEMENT, factory.getQName("x")) return
the XQuery type element(x)
.
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.Item createItem(boolean value)
value
- a boolean value
Item createItem(double value)
value
- a double value
Item createItem(float value)
value
- a float value
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.Item createItem(InputSource source) throws EvaluationException, IOException
source
- a SAX input source
EvaluationException
- wraps a parsing exception
IOException
- if the source cannot be readItem 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
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 errorItemSequence 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
|
© 2010 Axyana Software | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |