Package org.picocontainer
Interface PicoVisitor
- All Known Implementing Classes:
AbstractPicoVisitor
,MethodCallingVisitor
,TraversalCheckingVisitor
,VerifyingVisitor
public interface PicoVisitor
Interface realizing a visitor pattern for
PicoContainer
as described in the GoF.
The visitor should visit the container, its children, all registered ComponentAdapter
instances and all instantiated components.- Author:
- Aslak Hellesøy, Jörg Schaible
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final boolean
Constant that indicates that the traversal should abort after the visit*() method has been called.static final boolean
Constant that indicates that the traversal should continue after the visit*() method has been called. -
Method Summary
Modifier and TypeMethodDescriptionEntry point for the PicoVisitor traversal.void
visitComponentAdapter
(ComponentAdapter<?> componentAdapter) Visit aComponentAdapter
that has to accept the visitor.void
visitComponentFactory
(ComponentFactory componentFactory) Visit aComponentAdapter
that has to accept the visitor.boolean
visitContainer
(PicoContainer pico) Visit aPicoContainer
that has to accept the visitor.void
visitParameter
(Parameter parameter) Visit aParameter
that has to accept the visitor.
-
Field Details
-
CONTINUE_TRAVERSAL
static final boolean CONTINUE_TRAVERSALConstant that indicates that the traversal should continue after the visit*() method has been called.- See Also:
-
ABORT_TRAVERSAL
static final boolean ABORT_TRAVERSALConstant that indicates that the traversal should abort after the visit*() method has been called.- See Also:
-
-
Method Details
-
traverse
Entry point for the PicoVisitor traversal. The given node is the first object, that is asked for acceptance. Only objects of typePicoContainer
,ComponentAdapter
, orParameter
are valid.- Parameters:
node
- the start node of the traversal.- Returns:
- a visitor-specific value.
- Throws:
IllegalArgumentException
- in case of an argument of invalid type.
-
visitContainer
Visit aPicoContainer
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
Visit aComponentAdapter
that has to accept the visitor.- Parameters:
componentAdapter
- the visited ComponentAdapter.
-
visitComponentFactory
Visit aComponentAdapter
that has to accept the visitor.- Parameters:
componentAdapter
- the visited ComponentAdapter.
-
visitParameter
Visit aParameter
that has to accept the visitor.- Parameters:
parameter
- the visited Parameter.
-