org.apache.xml.dtm.ref

Class DTMNodeIterator

public class DTMNodeIterator extends Object implements NodeIterator

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!!

Constructor Summary
DTMNodeIterator(DTMIterator dtmIterator)
Public constructor: Wrap a DTMNodeIterator around an existing and preconfigured DTMIterator
Method Summary
voiddetach()
Detaches the NodeIterator from the set which it iterated over, releasing any computational resources and placing the iterator in the INVALID state.
DTMIteratorgetDTMIterator()
Access the wrapped DTMIterator.
booleangetExpandEntityReferences()
The value of this flag determines whether the children of entity reference nodes are visible to the iterator.
NodeFiltergetFilter()
Return a handle to the filter used to screen nodes.
NodegetRoot()
intgetWhatToShow()
Return a mask describing which node types are presented via the iterator.
NodenextNode()
NodepreviousNode()

Constructor Detail

DTMNodeIterator

public DTMNodeIterator(DTMIterator dtmIterator)
Public constructor: Wrap a DTMNodeIterator around an existing and preconfigured DTMIterator

Method Detail

detach

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

getDTMIterator

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.

getExpandEntityReferences

public boolean getExpandEntityReferences()
The value of this flag determines whether the children of entity reference nodes are visible to the iterator.

Returns: false, always (the DTM model flattens entity references)

getFilter

public NodeFilter 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.

Throws: DOMException -- NOT_SUPPORTED_ERROR because I can't think of anything more useful to do in this case

getRoot

public Node getRoot()

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

getWhatToShow

public int getWhatToShow()
Return a mask describing which node types are presented via the iterator.

nextNode

public Node nextNode()

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

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

previousNode

public Node previousNode()

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

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

Copyright B) 2006 Apache XML Project. All Rights Reserved.