to.etc.domui.util
Interface DomUtil.IPerNode

Enclosing class:
DomUtil

public static interface DomUtil.IPerNode

Functor interface to handle tree walking.

Author:
Frits Jalvingh Created on Nov 3, 2009

Field Summary
static java.lang.Object SKIP
          When this object instance is returned by the before(NodeBase) method we SKIP the downwards traversal.
 
Method Summary
 java.lang.Object after(NodeBase n)
          Called when all child nodes of the specified node have been traversed.
 java.lang.Object before(NodeBase n)
          Called when the node is first encountered in the tree.
 

Field Detail

SKIP

static final java.lang.Object SKIP
When this object instance is returned by the before(NodeBase) method we SKIP the downwards traversal.

Method Detail

before

java.lang.Object before(NodeBase n)
                        throws java.lang.Exception
Called when the node is first encountered in the tree. It can return null causing the rest of the tree to be traversed; if it returns the constant IPerNode.SKIP the subtree starting at this node will not be traversed but the rest of the tree will. When you return SKIP the after(NodeBase) method will not be called for this node. Returning any other value will stop the node traversal process and return that value to the caller of DomUtil.walkTree(NodeBase, IPerNode).

Parameters:
n -
Returns:
Throws:
java.lang.Exception

after

java.lang.Object after(NodeBase n)
                       throws java.lang.Exception
Called when all child nodes of the specified node have been traversed. When this returns a non-null value this will terminate the tree walk and return that value to the called of DomUtil.walkTree(NodeBase, IPerNode).

Parameters:
n -
Returns:
Throws:
java.lang.Exception