The whatToShow and filter functionality is implemented as expected.
This class also has method removeNode to enable iterator "fix-up" on DOM remove. It is expected that the DOM implementation call removeNode right before the actual DOM transformation. If not called by the DOM, the client could call it before doing the removal.
| Modifier and Type | Field and Description |
|---|---|
| private Node | fCurrentNode
The last Node returned. |
| private boolean | fDetach
If detach is called, the fDetach flag is true, otherwise flase. |
| private DocumentImpl | fDocument
The DocumentImpl which created this iterator, so it can be detached. |
| private boolean | fEntityReferenceExpansion
When TRUE, the children of entites references are returned in the iterator. |
| private boolean | fForward
The direction of the iterator on the fCurrentNode. |
| private NodeFilter | fNodeFilter
The NodeFilter reference. |
| private Node | fRoot
The root. |
| private int | fWhatToShow
The whatToShow mask. |
| Access | Constructor and Description |
|---|---|
| public | NodeIteratorImpl(DocumentImpl document, Node root, int whatToShow, NodeFilter nodeFilter, boolean entityReferenceExpansion)
Public constructor |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv boolean | |
| public void | detach()
Implements org. Detaches the |
| public boolean | getExpandEntityReferences()
Implements org. Return whether children entity references are included in the iterator. |
| public NodeFilter | |
| public Node | getRoot()
Implements org. The root node of the |
| public int | getWhatToShow()
Implements org. Return the whatToShow value |
| pack-priv Node | |
| public Node | nextNode()
Implements org. Return the next Node in the Iterator. |
| pack-priv Node | |
| public Node | previousNode()
Implements org. Return the previous Node in the Iterator. |
| pack-priv Node | previousNode(Node node)
The method previousNode(Node) returns the previous node from the actual DOM tree. |
| public void |
| fCurrentNode | back to summary |
|---|---|
| private Node fCurrentNode The last Node returned. | |
| fDetach | back to summary |
|---|---|
| private boolean fDetach If detach is called, the fDetach flag is true, otherwise flase. | |
| fDocument | back to summary |
|---|---|
| private DocumentImpl fDocument The DocumentImpl which created this iterator, so it can be detached. | |
| fEntityReferenceExpansion | back to summary |
|---|---|
| private boolean fEntityReferenceExpansion When TRUE, the children of entites references are returned in the iterator. | |
| fForward | back to summary |
|---|---|
| private boolean fForward The direction of the iterator on the fCurrentNode. nextNode() == fForward = true; previousNode() == fForward = false; | |
| fNodeFilter | back to summary |
|---|---|
| private NodeFilter fNodeFilter The NodeFilter reference. | |
| fRoot | back to summary |
|---|---|
| private Node fRoot The root. | |
| fWhatToShow | back to summary |
|---|---|
| private int fWhatToShow The whatToShow mask. | |
| NodeIteratorImpl | back to summary |
|---|---|
| public NodeIteratorImpl(DocumentImpl document, Node root, int whatToShow, NodeFilter nodeFilter, boolean entityReferenceExpansion) Public constructor | |
| acceptNode | back to summary |
|---|---|
| pack-priv boolean acceptNode(Node node) The node is accepted if it passes the whatToShow and the filter. | |
| detach | back to summary |
|---|---|
| public void detach() Implements org. Doc from org. Detaches the | |
| getExpandEntityReferences | back to summary |
|---|---|
| public boolean getExpandEntityReferences() Implements org. Return whether children entity references are included in the iterator. | |
| getFilter | back to summary |
|---|---|
| public NodeFilter getFilter() Implements org. Return the filter | |
| getRoot | back to summary |
|---|---|
| public Node getRoot() Implements org. Doc from org. The root node of the | |
| getWhatToShow | back to summary |
|---|---|
| public int getWhatToShow() Implements org. Return the whatToShow value | |
| matchNodeOrParent | back to summary |
|---|---|
| pack-priv Node matchNodeOrParent(Node node) Return node, if matches or any parent if matches. | |
| nextNode | back to summary |
|---|---|
| public Node nextNode() Implements org. Return the next Node in the Iterator. The node is the next node in depth-first order which also passes the filter, and whatToShow. If there is no next node which passes these criteria, then return null. | |
| nextNode | back to summary |
|---|---|
| pack-priv Node nextNode(Node node, boolean visitChildren) The method nextNode(Node, boolean) returns the next node from the actual DOM tree. The boolean visitChildren determines whether to visit the children. The result is the nextNode. | |
| previousNode | back to summary |
|---|---|
| public Node previousNode() Implements org. Return the previous Node in the Iterator. The node is the next node in _backwards_ depth-first order which also passes the filter, and whatToShow. | |
| previousNode | back to summary |
|---|---|
| pack-priv Node previousNode(Node node) The method previousNode(Node) returns the previous node from the actual DOM tree. | |
| removeNode | back to summary |
|---|---|
| public void removeNode(Node node) Fix-up the iterator on a remove. Called by DOM or otherwise, before an actual DOM remove. | |