edu.wpi.cs.dsrg.xmldb.xat.common.visitorpattern
Interface Visitor

All Known Implementing Classes:
InheritableVisitor

public interface Visitor

The visitor provide the additional functionality to an existing data structure. This data structure should be open enough to make the visitor make the job down.

Usually, the Visitable class should provide public methods to access its data.


Method Summary
 java.lang.Object visit(java.lang.Object object)
          In the visit() function, you don't need to provide any kind of traversal strategy.
 

Method Detail

visit

public java.lang.Object visit(java.lang.Object object)
In the visit() function, you don't need to provide any kind of traversal strategy. That should be provided by the accept() function in the Visitable classes.

It will only provide the additional functionality except the traversing provided by the accept() function.

The visit function should NEVER call obj.accept()!!!! Because that interfere with the traverse strategy in the obj.accept().

If there is an inheritance between the visited objects, it will only match the highest class.

Parameters:
object - The object visited.
Returns:
Object
Since:
1.0