com.ibm.xml.xapi

Interface XTreeCursor

All Superinterfaces:
XItemView, XNodeView

  1. public interface XTreeCursor
  2. 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

Modifier and Type Method and Description
  1. XItemView
getSingletonItem()
Get the current node as a singleton.
  1. boolean
toFirstAttribute()
Moves the cursor to the first attribute.
  1. boolean
toFirstChild()
Moves the cursor to the first child.
  1. boolean
toFirstNamespace()
Moves the cursor to the first namespace.
  1. boolean
toNextAttribute()
Moves the cursor to the next attribute.
  1. boolean
toNextNamespace()
Moves the cursor to the next namespace.
  1. boolean
toNextSibling()
Moves the cursor to the next sibling element.
  1. boolean
toParent()
Moves the cursor to the parent node.
  1. 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

  1. 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

  1. 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

  1. 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

  1. 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

  1. 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

  1. 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

  1. 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

  1. boolean toRoot()
Moves the cursor to the root node.
Returns:
Returns true (this method will always return true).

getSingletonItem

  1. 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.