org.picocontainer.visitors
Class TraversalCheckingVisitor
java.lang.Object
org.picocontainer.visitors.AbstractPicoVisitor
org.picocontainer.visitors.TraversalCheckingVisitor
- All Implemented Interfaces:
- PicoVisitor
- Direct Known Subclasses:
- MethodCallingVisitor, VerifyingVisitor
public class TraversalCheckingVisitor
- extends AbstractPicoVisitor
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 boolean visitContainer(PicoContainer pico) {
super.visitContainer(pico); //Calls checkTraversal for us.
allContainers.add(pico);
return true;
}
}
- Author:
- Michael Rimov
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TraversalCheckingVisitor
public TraversalCheckingVisitor()
visitContainer
public boolean visitContainer(PicoContainer pico)
- Visit a
PicoContainer
that has to accept the visitor.
- Parameters:
pico
- the visited container.
- Returns:
- CONTINUE_TRAVERSAL if the traversal should continue.
Any visitor callback that returns ABORT_TRAVERSAL indicates
the desire to abort any further traversal.
visitComponentAdapter
public void visitComponentAdapter(ComponentAdapter<?> componentAdapter)
- Visit a
ComponentAdapter
that has to accept the visitor.
- Parameters:
componentAdapter
- the visited ComponentAdapter.
visitComponentFactory
public void visitComponentFactory(ComponentFactory componentFactory)
- Visit a
ComponentAdapter
that has to accept the visitor.
visitParameter
public void visitParameter(Parameter parameter)
- Visit a
Parameter
that has to accept the visitor.
- Parameters:
parameter
- the visited Parameter.
Copyright © 2003-2010 Codehaus. All Rights Reserved.