Top Description Fields Constructors Methods
com.sun.org.apache.xml.internal.dtm.ref

public Class DTMNodeIterator

extends Object
implements NodeIterator
Class Inheritance
All Implemented Interfaces
org.w3c.dom.traversal.NodeIterator
Imports
com.sun.org.apache.xml.internal.dtm.DTM, .DTMDOMException, .DTMIterator, org.w3c.dom.DOMException, .Node, org.w3c.dom.traversal.NodeFilter

DTMNodeIterator gives us an implementation of the DTMNodeIterator which returns DOM nodes. Please note that this is not necessarily equivlaent to a DOM NodeIterator operating over the same document. In particular:

State: In progress!!

Field Summary

Modifier and TypeField and Description
private DTMIterator
private boolean

Constructor Summary

AccessConstructor and Description
public
DTMNodeIterator(DTMIterator dtmIterator)

Public constructor: Wrap a DTMNodeIterator around an existing and preconfigured DTMIterator

Method Summary

Modifier and TypeMethod and Description
public void
detach()

Implements org.w3c.dom.traversal.NodeIterator.detach.

Detaches the NodeIterator from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state.

public DTMIterator
getDTMIterator()

Access the wrapped DTMIterator.

public boolean

Returns:

false, always (the DTM model flattens entity references)
getExpandEntityReferences
()

Implements org.w3c.dom.traversal.NodeIterator.getExpandEntityReferences.

The value of this flag determines whether the children of entity reference nodes are visible to the iterator.

public NodeFilter
getFilter()

Implements org.w3c.dom.traversal.NodeIterator.getFilter.

Return a handle to the filter used to screen nodes.

public Node

Returns:

The root node of the NodeIterator, as specified when it was created.
getRoot
()

Implements org.w3c.dom.traversal.NodeIterator.getRoot.

The root node of the NodeIterator, as specified when it was created.

public int
getWhatToShow()

Implements org.w3c.dom.traversal.NodeIterator.getWhatToShow.

Return a mask describing which node types are presented via the iterator.

public Node

Returns:

the next node in the set and advance the position of the iterator in the set.
nextNode
()

Implements org.w3c.dom.traversal.NodeIterator.nextNode.

Returns the next node in the set and advances the position of the NodeIterator in the set.

public Node

Returns:

the next previous in the set and advance the position of the iterator in the set.
previousNode
()

Implements org.w3c.dom.traversal.NodeIterator.previousNode.

Returns the previous node in the set and moves the position of the NodeIterator backwards in the set.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dtm_iterback to summary
private DTMIterator dtm_iter
validback to summary
private boolean valid

Constructor Detail

DTMNodeIteratorback to summary
public DTMNodeIterator(DTMIterator dtmIterator)

Public constructor: Wrap a DTMNodeIterator around an existing and preconfigured DTMIterator

Method Detail

detachback to summary
public void detach()

Implements org.w3c.dom.traversal.NodeIterator.detach.

Detaches the NodeIterator from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state.

getDTMIteratorback to summary
public DTMIterator getDTMIterator()

Access the wrapped DTMIterator. I'm not sure whether anyone will need this or not, but let's write it and think about it.

getExpandEntityReferencesback to summary
public boolean getExpandEntityReferences()

Implements org.w3c.dom.traversal.NodeIterator.getExpandEntityReferences.

The value of this flag determines whether the children of entity reference nodes are visible to the iterator.

Returns:boolean

false, always (the DTM model flattens entity references)

getFilterback to summary
public NodeFilter getFilter()

Implements org.w3c.dom.traversal.NodeIterator.getFilter.

Return a handle to the filter used to screen nodes. This is ill-defined in Xalan's usage of Nodeiterator, where we have built stateful XPath-based filtering directly into the traversal object. We could return something which supports the NodeFilter interface and allows querying whether a given node would be permitted if it appeared as our next node, but in the current implementation that would be very complex -- and just isn't all that useful.

Exceptions
DOMException:
-- NOT_SUPPORTED_ERROR because I can't think of anything more useful to do in this case
getRootback to summary
public Node getRoot()

Implements org.w3c.dom.traversal.NodeIterator.getRoot.

Doc from org.w3c.dom.traversal.NodeIterator.getRoot.

The root node of the NodeIterator, as specified when it was created.

Returns:Node

The root node of the NodeIterator, as specified when it was created.

getWhatToShowback to summary
public int getWhatToShow()

Implements org.w3c.dom.traversal.NodeIterator.getWhatToShow.

Return a mask describing which node types are presented via the iterator.

nextNodeback to summary
public Node nextNode() throws DOMException

Implements org.w3c.dom.traversal.NodeIterator.nextNode.

Doc from org.w3c.dom.traversal.NodeIterator.nextNode.

Returns the next node in the set and advances the position of the NodeIterator in the set. After a NodeIterator is created, the first call to nextNode() returns the first node in the set.

Returns:Node

the next node in the set and advance the position of the iterator in the set.

Exceptions
DOMException:
- INVALID_STATE_ERR Raised if this method is called after the detach method was invoked.
previousNodeback to summary
public Node previousNode()

Implements org.w3c.dom.traversal.NodeIterator.previousNode.

Doc from org.w3c.dom.traversal.NodeIterator.previousNode.

Returns the previous node in the set and moves the position of the NodeIterator backwards in the set.

Returns:Node

the next previous in the set and advance the position of the iterator in the set.

Exceptions
DOMException:
- INVALID_STATE_ERR Raised if this method is called after the detach method was invoked.