1 package com.sri.emo.dbobj.model_tree;
2
3 import com.sri.emo.dbobj.*;
4
5 /***
6 * <tt>Visitor</tt> that allows for visiting of IViewable interface objects.
7 * Because of the nature of the Visitor pattern, every time a new object
8 * is added that derives from IViewable, you need to modify the ViewVisitor
9 * interface appropriately.
10 * <p>Each visit may throw a ViewVisitorException which is a runtime
11 * exception. You may catch it while processing the nodes if you wish.</p>
12 *
13 * @author Michael Rimov
14 */
15 public interface ModelVisitor {
16
17 /***
18 * Visits an attribute.
19 *
20 * @param attribute Attribute
21 * @throws ViewVisitorException upon error.
22 */
23 void visitAttribute(Attribute attribute);
24
25 /***
26 * Visits a Node.
27 *
28 * @param node Node
29 * @throws ViewVisitorException upon error.
30 */
31 void visitNode(Node node);
32
33 /***
34 * Visits a <tt>NodeType<tt>
35 *
36 * @param nodeType NodeType
37 * @throws ViewVisitorException upon error.
38 */
39 void visitNodeType(NodeType nodeType);
40
41 /***
42 * Visits a <tt>Part</tt>
43 *
44 * @param part Part
45 * @throws ViewVisitorException upon error.
46 */
47 void visitPart(Part part);
48
49 /***
50 * Visits a picklist.
51 *
52 * @param picklist PickList
53 * @throws ViewVisitorException upon error.
54 */
55 void visitPickList(PickList picklist);
56
57 /***
58 * Visits a <tt>Relation</tt>
59 *
60 * @param relation Relation
61 * @throws ViewVisitorException upon error.
62 */
63 void visitRelation(Relation relation);
64
65 }