Package org.picocontainer
Interface PicoVisitor
-
- All Known Implementing Classes:
AbstractPicoVisitor,MethodCallingVisitor,TraversalCheckingVisitor,VerifyingVisitor
public interface PicoVisitorInterface realizing a visitor pattern forPicoContaineras described in the GoF. The visitor should visit the container, its children, all registeredComponentAdapterinstances and all instantiated components.- Author:
- Aslak Hellesøy, Jörg Schaible
-
-
Field Summary
Fields Modifier and Type Field Description static booleanABORT_TRAVERSALConstant that indicates that the traversal should abort after the visit*() method has been called.static booleanCONTINUE_TRAVERSALConstant that indicates that the traversal should continue after the visit*() method has been called.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Objecttraverse(java.lang.Object node)Entry point for the PicoVisitor traversal.voidvisitComponentAdapter(ComponentAdapter<?> componentAdapter)Visit aComponentAdapterthat has to accept the visitor.voidvisitComponentFactory(ComponentFactory componentFactory)Visit aComponentAdapterthat has to accept the visitor.booleanvisitContainer(PicoContainer pico)Visit aPicoContainerthat has to accept the visitor.voidvisitParameter(Parameter parameter)Visit aParameterthat has to accept the visitor.
-
-
-
Field Detail
-
CONTINUE_TRAVERSAL
static final boolean CONTINUE_TRAVERSAL
Constant that indicates that the traversal should continue after the visit*() method has been called.- See Also:
- Constant Field Values
-
ABORT_TRAVERSAL
static final boolean ABORT_TRAVERSAL
Constant that indicates that the traversal should abort after the visit*() method has been called.- See Also:
- Constant Field Values
-
-
Method Detail
-
traverse
java.lang.Object traverse(java.lang.Object node)
Entry point for the PicoVisitor traversal. The given node is the first object, that is asked for acceptance. Only objects of typePicoContainer,ComponentAdapter, orParameterare valid.- Parameters:
node- the start node of the traversal.- Returns:
- a visitor-specific value.
- Throws:
java.lang.IllegalArgumentException- in case of an argument of invalid type.
-
visitContainer
boolean visitContainer(PicoContainer pico)
Visit aPicoContainerthat 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
void visitComponentAdapter(ComponentAdapter<?> componentAdapter)
Visit aComponentAdapterthat has to accept the visitor.- Parameters:
componentAdapter- the visited ComponentAdapter.
-
visitComponentFactory
void visitComponentFactory(ComponentFactory componentFactory)
Visit aComponentAdapterthat has to accept the visitor.- Parameters:
componentAdapter- the visited ComponentAdapter.
-
-