org.picocontainer.visitors
Class AbstractPicoVisitor
java.lang.Object
org.picocontainer.visitors.AbstractPicoVisitor
- All Implemented Interfaces:
- PicoVisitor
- Direct Known Subclasses:
- TraversalCheckingVisitor
public abstract class AbstractPicoVisitor
- extends Object
- implements PicoVisitor
Abstract PicoVisitor implementation. A generic traverse method is implemented, that
accepts any object with a method named "accept", that takes a
PicoVisitor
as argument and and invokes it. Additionally it provides the
checkTraversal()
method, that throws a AbstractPicoVisitor.PicoVisitorTraversalException
,
if currently no traversal is running.
- Author:
- Jörg Schaible
Method Summary |
protected void |
checkTraversal()
Checks the traversal flag, indicating a currently running traversal of the visitor. |
Object |
traverse(Object node)
Entry point for the PicoVisitor traversal. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractPicoVisitor
public AbstractPicoVisitor()
traverse
public Object traverse(Object node)
- Description copied from interface:
PicoVisitor
- Entry point for the PicoVisitor traversal. The given node is the first object, that is
asked for acceptance. Only objects of type
PicoContainer
, ComponentAdapter
,
or Parameter
are valid.
- Specified by:
traverse
in interface PicoVisitor
- Parameters:
node
- the start node of the traversal.
- Returns:
- a visitor-specific value.
checkTraversal
protected void checkTraversal()
- Checks the traversal flag, indicating a currently running traversal of the visitor.
- Throws:
AbstractPicoVisitor.PicoVisitorTraversalException
- if no traversal is active.
Copyright © 2003-2010 Codehaus. All Rights Reserved.