org.pietschy.command
Class AbstractVisitor
java.lang.Object
org.pietschy.command.AbstractVisitor
- All Implemented Interfaces:
- GroupVisitor
- Direct Known Subclasses:
- MatchVisitor, RemoveVisitor, ResetVisitor
public abstract class AbstractVisitor
- extends java.lang.Object
- implements GroupVisitor
AbstractVisitor provides a default implementation of GroupVisitor
that predefines
a number of visitation modes by providing a default implementation of conditionallyVisitChildren(org.pietschy.command.CommandGroup)
.
The available modes are as follows.
- SHALLOW
-
The visitor will visit the parent group and its immediate children only. The children of
any inline group will be visited as if they are members of the main group.
- DEEP
-
The visitor traverse the entire graph of commands under the top level group.
- Version:
- $Revision: 1.5 $
- Author:
- andrewp
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SHALLOW
public static final AbstractVisitor.VisitMode SHALLOW
- The visitor will visit the immediate children only (including inline children).
DEEP
public static final AbstractVisitor.VisitMode DEEP
- The visitor traverse the entire graph of commands under the top level group.
mode
protected AbstractVisitor.VisitMode mode
- The mode in which the visitor should operate.
AbstractVisitor
public AbstractVisitor(AbstractVisitor.VisitMode mode)
- Constructs a new Abstract visitor using the specified visitation mode.
- Parameters:
mode
- the AbstractVisitor.VisitMode
the visitor should use.
conditionallyVisitChildren
public void conditionallyVisitChildren(CommandGroup group)
isParentGroup
protected boolean isParentGroup(CommandGroup group)