|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.s9api.XdmValue net.sf.saxon.s9api.XdmItem
public abstract class XdmItem
The class XdmItem represents an item in a sequence, as defined by the XDM data model. An item is either an atomic value or a node.
An item is a member of a sequence, but it can also be considered as a sequence (of length one) in its own right. XdmItem is a subtype of XdmValue because every Item in the XDM data model is also a value.
It cannot be assumed that every sequence of length one will be represented by an XdmItem. It is quite possible for an XdmValue that is not an XdmItem to hold a singleton sequence.
Saxon provides two concrete subclasses of XdmItem
, namely
XdmNode
and XdmAtomicValue
. Users must not attempt to create
additional subclasses.
Method Summary | |
---|---|
String |
getStringValue()
Get the string value of the item. |
boolean |
isAtomicValue()
Determine whether the item is an atomic value or a node |
static XdmItem |
newAtomicValue(String value,
ItemType type)
Factory method to construct an atomic value given its lexical representation and the required item type |
int |
size()
Get the number of items in the sequence |
Methods inherited from class net.sf.saxon.s9api.XdmValue |
---|
getUnderlyingValue, itemAt, iterator |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static XdmItem newAtomicValue(String value, ItemType type) throws SaxonApiException
value
- the lexical representation of the required valuetype
- the item type of the required value
SaxonApiException
- if the supplied string is not in the lexical space of the target type, or
if the target type is not atomicpublic String getStringValue()
For atomic values, the result is the same as the result of calling
toString
. This is not the case for nodes, where toString
returns an XML serialization of the node.
public boolean isAtomicValue()
public int size()
size
in class XdmValue
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |