|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GuCursor<N>
A cursor is a random-access representation of an XML tree with the unique property that it moves over the underlying data model without forcing the implementation to provide object handles for each node visited.
A cursor may be moved over the underlying data model and provides access to the properties of its underlying node.
Method Summary | |
---|---|
N |
bookmark()
|
java.lang.Iterable<javax.xml.namespace.QName> |
getAttributeNames(boolean orderCanonical)
Returns the set of attribute names for the current node. |
int |
getLineNumber()
Returns the line number, or -1 if none is available. |
java.lang.String |
getLocalName()
Returns the local-name property of the dm:node-name. |
java.lang.Iterable<java.lang.String> |
getNamespaceNames(boolean orderCanonical)
Returns the set of namespace names (prefixes) for the current node. |
java.lang.String |
getNamespaceURI()
Returns the namespace-uri part of the dm:node-name. |
NodeKind |
getNodeKind()
Returns the dm:node-kind property of the XDM as an enumeration in NodeKind . |
java.lang.String |
getPrefix()
Returns the prefix part of the dm:node-name. |
GuProcessingContext<N> |
getProcessingContext()
Returns the processing context that is effective for this cursor. |
java.lang.String |
getStringValue()
|
boolean |
hasAttributes()
|
boolean |
hasChildren()
|
boolean |
hasNamespaces()
|
boolean |
hasNextSibling()
|
boolean |
hasParent()
|
boolean |
hasPreviousSibling()
|
boolean |
isSameNode(GuCursor<N> other)
Determines whether the current node is identically equal to the node specified by the argument. |
boolean |
matches(NodeKind nodeKind,
java.lang.String namespaceURI,
java.lang.String localName)
Deterimines whether the cursor matches the arguments. |
void |
moveTo(N bookmark)
Positions the cursor at the specified bookmark. |
boolean |
moveToAttribute(java.lang.String namespaceURI,
java.lang.String localName)
Moves to the attribute node with the specified expanded-QName. |
boolean |
moveToFirstChild()
Moves the cursor to the first node along the child axis. |
boolean |
moveToFirstChildElement()
Moves the cursor to the first element along the child axis. |
boolean |
moveToFirstChildElementByName(java.lang.String namespaceURI,
java.lang.String localName)
Moves the cursor to the first element with the specified name along the child axis. |
boolean |
moveToLastChild()
Moves the cursor to the last node along the child axis. |
boolean |
moveToNextSibling()
Moves the cursor to the next node along the following-sibling axis. |
boolean |
moveToNextSiblingElement()
Moves the cursor to the next element along the following-sibling axis. |
boolean |
moveToNextSiblingElementByName(java.lang.String namespaceURI,
java.lang.String localName)
Moves the cursor to the next element along the following-sibling axis. |
boolean |
moveToParent()
Moves the cursor to the node along the parent axis. |
boolean |
moveToPreviousSibling()
Moves the cursor to the next node along the preceding-sibling axis. |
void |
moveToRoot()
Moves the cursor to the farthest node along the ancestor axis. |
void |
write(GuContentHandler writer)
Support for streaming the current node to a GuContentHandler . |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Method Detail |
---|
N bookmark()
bookmark
in interface Cursor<N,java.lang.String,javax.xml.namespace.QName>
java.lang.Iterable<javax.xml.namespace.QName> getAttributeNames(boolean orderCanonical)
orderCanonical
- Determines whether the names will be returned in canonical order (lexicographically by namespace URI,
local name).int getLineNumber()
-1
if none is available.
java.lang.String getLocalName()
null
.
getLocalName
in interface Cursor<N,java.lang.String,javax.xml.namespace.QName>
java.lang.Iterable<java.lang.String> getNamespaceNames(boolean orderCanonical)
orderCanonical
- Determines whether the names will be returned in canonical order (lexicographically by local name).java.lang.String getNamespaceURI()
null
.
NodeKind getNodeKind()
NodeKind
.
java.lang.String getPrefix()
GuProcessingContext<N> getProcessingContext()
getProcessingContext
in interface GuWritable<N>
java.lang.String getStringValue()
boolean hasAttributes()
true
if the node has attributes, otherwise false
.boolean hasChildren()
true
if the node has children, otherwise false
.boolean hasNamespaces()
true
if the node has prefix-to-namespace mappings, otherwise false
.boolean hasNextSibling()
true
if the node has a following sibling, otherwise false
.boolean hasParent()
true
if the node has a parent, otherwise false
.boolean hasPreviousSibling()
true
if the node has a preceding sibling, otherwise false
.boolean isSameNode(GuCursor<N> other)
boolean matches(NodeKind nodeKind, java.lang.String namespaceURI, java.lang.String localName)
nodeKind
- The node kind to match.namespaceURI
- The namespace-uri to match.localName
- The local-name to match.
true
if the cursor matches the specified arguments.void moveTo(N bookmark)
bookmark
- The bookmark to which the cursor should be positioned.boolean moveToAttribute(java.lang.String namespaceURI, java.lang.String localName)
namespaceURI
- The namespace-uri part of the attribute name.localName
- The local-name part of the attribute name.boolean moveToFirstChild()
true
if the cursor moved, otherwise false
.boolean moveToFirstChildElement()
true
if the cursor moved, otherwise false
.boolean moveToFirstChildElementByName(java.lang.String namespaceURI, java.lang.String localName)
true
if the cursor moved, otherwise false
.boolean moveToLastChild()
true
if the cursor moved, otherwise false
.boolean moveToNextSibling()
true
if the cursor moved, otherwise false
.boolean moveToNextSiblingElement()
true
if the cursor moved, otherwise false
.boolean moveToNextSiblingElementByName(java.lang.String namespaceURI, java.lang.String localName)
true
if the cursor moved, otherwise false
.boolean moveToParent()
true
if the cursor moved, otherwise false
.boolean moveToPreviousSibling()
true
if the cursor moved, otherwise false
.void moveToRoot()
void write(GuContentHandler writer) throws java.io.IOException
GuContentHandler
.
write
in interface GuWritable<N>
writer
- The handler for events generated.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |