|
API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface XTreeCursor
Represents a node providing cursor access to the attributes and children
of the node. Traversal of the tree is achieved through the various
"to" methods. When any of these methods
is used the cursor will change state as it will now be pointing
to a different node in the tree. This means that other
references to the same XTreeCursor
object will also
now be pointing to the new node.
An XTreeCursor
can be obtained by using the
XNodeView
getTreeCursor
interface.
XtreeCursor
implements XItemView
which
in turn implements XNodeView
allowing each to be
examined as the cursor is traversed. The XItemView
interface provides access to the schema type and typed value of a node.
The XNodeView
interface provides access to the node name,
node kind, etc.
Examples:
toFirstAttribute
method to move the cursor to the first attribute. Use the toNextAttribute
method to move the cursor to the following attributes, one at a time. Use the
toParent
method to go back to the element.
toFirstChild
method
to move the cursor to the first child. Use the toNextSibling
method
to move the cursor to the following children, one at a time. Use the
toParent
method to go back to the element.
toFirstNamespace
method to move the cursor to the first namespace. Use the toNextNamespace
method to move the cursor to the following namespaces, one at a time. Use the
toParent
method to go back to the element.
XItemView
,
XNodeView
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.ibm.xml.xapi.XNodeView |
---|
XNodeView.Kind |
Method Summary | |
---|---|
XItemView |
getSingletonItem()
Get the current node as a singleton. |
boolean |
toFirstAttribute()
Moves the cursor to the first attribute. |
boolean |
toFirstChild()
Moves the cursor to the first child. |
boolean |
toFirstNamespace()
Moves the cursor to the first namespace. |
boolean |
toNextAttribute()
Moves the cursor to the next attribute. |
boolean |
toNextNamespace()
Moves the cursor to the next namespace. |
boolean |
toNextSibling()
Moves the cursor to the next sibling element. |
boolean |
toParent()
Moves the cursor to the parent node. |
boolean |
toRoot()
Moves the cursor to the root node. |
Methods inherited from interface com.ibm.xml.xapi.XNodeView |
---|
getDOMNode, getKind, getNodeQName, getTreeCursor, isSameDocument, relativePosition |
Method Detail |
---|
boolean toFirstChild()
true
if the move was successful, false
otherwise. The
move may be unsuccessful if there are no children or if
the cursor is not currently positioned on an element node
or document node.boolean toFirstAttribute()
true
if the move was successful, false
otherwise. The
move may be unsuccessful if there are no attributes or if
the cursor is not currently positioned on an element node.boolean toFirstNamespace()
true
if the move was successful, false
otherwise. The
move may be unsuccessful if there are no namespaces or if
the cursor is not currently positioned on an element node.boolean toNextSibling()
true
if the move was successful false
otherwise.
The move may be unsuccessful if there are no more siblings.boolean toNextAttribute()
true
if the move was successful false
otherwise.
The move may be unsuccessful if there are no more attributes
or if not at the attribute level (toFirstAttribute was not
called).boolean toNextNamespace()
true
if the move was successful false
otherwise.
The move may be unsuccessful if there are no more namespaces
or if not at the namespace level (toFirstNamespace was not
called).boolean toParent()
true
if the move was successful false
otherwise.
The move may be unsuccessful if the cursor is currently
positioned at the root.boolean toRoot()
true
(this method will always return true).XItemView getSingletonItem()
XTreeCursor
implements XItemView
which in turn implements XNodeView
.
It is intended to be called only when a standalone item is needed that
will not be affected by calls to the "to" methods on
the original tree cursor.
XItemView
object.
|
IBM Copyright 2004-2008 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |