| Concrete implementation of Visitor which simply checks traversals.
This can be a useful class for other Visitor implementations to extend,
as it provides a default implementation in case you one is only interested
in one PicoVisitor type. Example:
PicoContainer container = new DefaultPicoContainer();
PicoContainer child = container.makeChildContainer();
final List allContainers = new ArrayList();
PicoVisitor visitor = new TraversalCheckingVisitor() {
public void visitContainer(PicoContainer pico) {
super.visitContainer(pico); //Calls checkTraversal for us.
allContainers.add(pico);
}
}
author: Micheal Rimov |