{@link org.jdom.Element} nodes in a given DOM tree (or sub-tree) are alwaysvisited. However, other types of node can also be visited by utilizing the supplied mask values (such as {@link #ATTRIBUTES}) in the {@link #nextHeader(Element,Visitor,int) nextHeader} method's inclusionMaskparameter. The mask values must be ORed together into the inclusionMask.
The walker implements the entire DOM traversal independent of the visitor.
The traversal can be controlled by the visitor's nextHeader method return values. Normal traversals are performed by returning the {@link Visitor.Action#CONTINUE CONTINUE} literal. Traversal of the "current"element can be terminated early by returning {@link Visitor.Action#SKIP SKIP}, where the current element is the parent of a current non-Element node. The whole traversal can be terminated by returning {@link Visitor.Action#STOP STOP}.
| |