|
Qizx fe-4.4p2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Node
Nodes of the Document Data Model, as defined by XQuery1/XPath2, plus extensions.
Caution: a node of a Data Model can be represented by several
different instances of Node. Therefore Node instances should never be
compared with ==
, but with the equals
method, or possibly with the documentOrderCompareTo method.
Common exception causes: the node belongs to an unreachable Document (deleted or belonging to a closed Library).
Field Summary | |
---|---|
static int |
ATOM_ANY
Node nature (returned by getNodeNature) for typed leaf node holding a value of any serializable class. |
static int |
ATOM_BOOLEAN
Node nature (returned by getNodeNature) for a typed leaf node holding a boolean value. |
static int |
ATOM_DATE
Node nature (returned by getNodeNature) for typed leaf node holding a date/time value. |
static int |
ATOM_DOUBLE
Node nature (returned by getNodeNature) for a typed leaf node holding a double value. |
static int |
ATOM_LONG
Node nature (returned by getNodeNature) for a typed integer node, holding a long integer value. |
static int |
ATTRIBUTE
Node nature (returned by getNodeNature) for an Attribute node. |
static int |
COMMENT
Node nature (returned by getNodeNature) for a Comment node. |
static int |
DOCUMENT
Node nature (returned by getNodeNature) for a document node. |
static int |
ELEMENT
Node nature (returned by getNodeNature) for an Element node. |
static int |
NAMESPACE
Node nature (returned by getNodeNature) for a namespace node. |
static int |
PROCESSING_INSTRUCTION
Node nature (returned by getNodeNature) for a processing instruction node. |
static int |
TEXT
Node nature (returned by getNodeNature) for a leaf text node. |
Method Summary | |
---|---|
boolean |
contains(Node node)
Returns true if this node is an ancestor of the parameter node or the node itself. |
boolean |
deepEquals(Node node,
Collator collator)
Deep equality of two subtrees. |
int |
documentOrderCompareTo(Node that)
Compares the document order of two nodes. |
Object |
getAtomValue()
Returns the value of an atomic node. |
Node |
getAttribute(QName name)
Gets an attribute of an element by name. |
int |
getAttributeCount()
Returns the number of attributes of an Element. |
Node[] |
getAttributes()
Gets the attributes of an element. |
String |
getBaseURI()
Return the base-URI of this Node. |
char[] |
getCharValue()
Returns the String Value of this leaf Node as a char array. |
Node |
getDocumentNode()
Returns the document node if any, else the top-level node. |
String |
getDocumentURI()
Returns the URI of the document. |
Node |
getFirstChild()
Returns the first child node of an element or a document node. |
Document |
getLibraryDocument()
Returns the XML Library Document the Node belongs to, if applicable. |
long |
getLongAtomValue()
Returns the node contents as an integer value. |
String |
getNamespacePrefix(String nsURI)
Returns a matching prefix for the Namespace URI by looking up the in-scope namespace definitions. |
String |
getNamespaceUri(String prefix)
Returns a matching Namespace for the prefix by looking up the in-scope namespace definitions. |
Node |
getNextNode()
Returns the next Node in document order. |
Node |
getNextSibling()
Returns the next sibling Node. |
String |
getNodeKind()
Returns the node kind as a string: "document", "element", "attribute", "text", "comment", or "processing-instruction". |
QName |
getNodeName()
Returns the Qualified Name of the node. |
int |
getNodeNature()
Returns a node kind in numeric form: DOCUMENT, ELEMENT etc. |
Node |
getParent()
Returns the parent node. |
String |
getStringValue()
Returns the String Value of this Node. |
boolean |
isElement()
Returns true if the Node is an Element. |
int |
stringValueCompareTo(Node node,
Collator collator)
Compares the string values of two nodes, optionally using a collation. |
Methods inherited from interface com.qizx.api.Item |
---|
export, exportNode, getBoolean, getDecimal, getDouble, getFloat, getInteger, getNode, getObject, getQName, getString, getType, isNode |
Field Detail |
---|
static final int DOCUMENT
static final int ELEMENT
static final int ATTRIBUTE
static final int NAMESPACE
static final int PROCESSING_INSTRUCTION
static final int COMMENT
static final int TEXT
static final int ATOM_BOOLEAN
static final int ATOM_LONG
static final int ATOM_DOUBLE
static final int ATOM_ANY
static final int ATOM_DATE
Method Detail |
---|
String getNodeKind() throws DataModelException
Corresponds to Data Model accessor dm:node-kind().
DataModelException
- common causesQName getNodeName() throws DataModelException
Corresponds to Data Model accessor dm:node-name().
DataModelException
- common causesNode getParent() throws DataModelException
Corresponds to the XQuery Data Model accessor dm:parent().
DataModelException
- common causesNode getFirstChild() throws DataModelException
DataModelException
- common causesNode getNextSibling() throws DataModelException
DataModelException
- common causesNode getNextNode() throws DataModelException
DataModelException
- common causesString getStringValue() throws DataModelException
Corresponds to the XQuery Data Model accessor dm:string-value().
DataModelException
- common causeschar[] getCharValue() throws DataModelException
Corresponds to the XQuery Data Model accessor dm:string-value().
DataModelException
- common causes, Node is not
atomic/leaf.String getBaseURI() throws DataModelException
Corresponds to the XQuery Data Model accessor dm:base-uri().
DataModelException
- common causesString getDocumentURI() throws DataModelException
DataModelException
- common causesNode getDocumentNode() throws DataModelException
DataModelException
- common causesDocument getLibraryDocument() throws DataModelException
DataModelException
- common causesint getNodeNature() throws DataModelException
DataModelException
- common causesboolean isElement() throws DataModelException
getNodeNature() == Node.ELEMENT
.
DataModelException
- common causesNode getAttribute(QName name) throws DataModelException
name
- qualified name of the sought attribute
DataModelException
- common causesNode[] getAttributes() throws DataModelException
DataModelException
- common causesint getAttributeCount() throws DataModelException
DataModelException
- common causesObject getAtomValue() throws DataModelException
DataModelException
- common causeslong getLongAtomValue() throws DataModelException
DataModelException
- if not convertible to integer;
common causesString getNamespacePrefix(String nsURI) throws DataModelException
nsURI
- a namespace URI as a String
DataModelException
- common causesString getNamespaceUri(String prefix) throws DataModelException
prefix
- a prefix as a String (canbe the empty string)
DataModelException
- common causesint documentOrderCompareTo(Node that) throws DataModelException
that
- other node to compare
DataModelException
- common causesint stringValueCompareTo(Node node, Collator collator) throws DataModelException
node
- other node to comparecollator
- an optional collator to compare string values; can be null
DataModelException
- common causesboolean deepEquals(Node node, Collator collator) throws DataModelException
node
- other node to comparecollator
- an optional collator to compare string values; can be null
DataModelException
- common causesboolean contains(Node node) throws DataModelException
node
- other node to check for containment
DataModelException
- common causes
|
© 2010 Axyana Software | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |