public class TraversalCheckingVisitor extends AbstractPicoVisitor
PicoContainer container = new DefaultPicoContainer();
PicoContainer child = container.makeChildContainer();
final List allContainers = new ArrayList();
PicoVisitor visitor = new TraversalCheckingVisitor() {
public boolean visitContainer(PicoContainer pico) {
super.visitContainer(pico); //Calls checkTraversal for us.
allContainers.add(pico);
return true;
}
}
AbstractPicoVisitor.PicoVisitorTraversalExceptionABORT_TRAVERSAL, CONTINUE_TRAVERSAL| Constructor and Description |
|---|
TraversalCheckingVisitor() |
| Modifier and Type | Method and Description |
|---|---|
void |
visitComponentAdapter(ComponentAdapter<?> componentAdapter)
Visit a
ComponentAdapter that has to accept the visitor. |
void |
visitComponentFactory(ComponentFactory componentFactory)
Visit a
ComponentAdapter that has to accept the visitor. |
boolean |
visitContainer(PicoContainer pico)
Visit a
PicoContainer that has to accept the visitor. |
void |
visitParameter(Parameter parameter)
Visit a
Parameter that has to accept the visitor. |
checkTraversal, traversepublic TraversalCheckingVisitor()
public boolean visitContainer(PicoContainer pico)
PicoContainer that has to accept the visitor.pico - the visited container.public void visitComponentAdapter(ComponentAdapter<?> componentAdapter)
ComponentAdapter that has to accept the visitor.componentAdapter - the visited ComponentAdapter.public void visitComponentFactory(ComponentFactory componentFactory)
ComponentAdapter that has to accept the visitor.public void visitParameter(Parameter parameter)
Parameter that has to accept the visitor.parameter - the visited Parameter.Copyright © 2003-2014 Codehaus. All Rights Reserved.