API

com.ibm.xml.xapi
Interface XTreeCursor

All Superinterfaces:
XItemView, XNodeView

public interface XTreeCursor
extends XItemView

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:

See Also:
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.XItemView
exportItem, exportItem, getAnyURIValue, getBase64BinaryValue, getBooleanValue, getByteValue, getDateTimeValue, getDateValue, getDayTimeDurationValue, getDecimalValue, getDoubleValue, getDurationValue, getFloatValue, getGDayValue, getGMonthDayValue, getGMonthValue, getGYearMonthValue, getGYearValue, getHexBinaryValue, getIntegerValue, getIntValue, getListValue, getLongValue, getNotationValue, getObjectValue, getQNameValue, getShortValue, getStringValue, getTimeValue, getUnionValue, getValueType, getValueTypeName, getYearMonthDurationValue, isAtomic
 
Methods inherited from interface com.ibm.xml.xapi.XNodeView
getDOMNode, getKind, getNodeQName, getTreeCursor, isSameDocument, relativePosition
 

Method Detail

toFirstChild

boolean toFirstChild()
Moves the cursor to the first child.

Returns:
Returns 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.

toFirstAttribute

boolean toFirstAttribute()
Moves the cursor to the first attribute.

Returns:
Returns 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.

toFirstNamespace

boolean toFirstNamespace()
Moves the cursor to the first namespace.

Returns:
Returns 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.

toNextSibling

boolean toNextSibling()
Moves the cursor to the next sibling element.

Returns:
Returns true if the move was successful false otherwise. The move may be unsuccessful if there are no more siblings.

toNextAttribute

boolean toNextAttribute()
Moves the cursor to the next attribute.

Returns:
Returns 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).

toNextNamespace

boolean toNextNamespace()
Moves the cursor to the next namespace.

Returns:
Returns 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).

toParent

boolean toParent()
Moves the cursor to the parent node.

Returns:
Returns true if the move was successful false otherwise. The move may be unsuccessful if the cursor is currently positioned at the root.

toRoot

boolean toRoot()
Moves the cursor to the root node.

Returns:
Returns true (this method will always return true).

getSingletonItem

XItemView getSingletonItem()
Get the current node as a singleton. This method does not need to be called in order to examine the current node since 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.

Returns:
A singleton XItemView object.

IBM Copyright 2004-2008