1
2
3
4
5
6
7
8 package org.dom4j;
9
10 /***
11 * <p>
12 * <code>Visitor</code> is used to implement the <code>Visitor</code>
13 * pattern in DOM4J. An object of this interface can be passed to a
14 * <code>Node</code> which will then call its typesafe methods. Please refer
15 * to the <i>Gang of Four </i> book of Design Patterns for more details on the
16 * <code>Visitor</code> pattern.
17 * </p>
18 *
19 * <p>
20 * This <a href="http://www.patterndepot.com/put/8/JavaPatterns.htm">site </a>
21 * has further discussion on design patterns and links to the GOF book. This <a
22 * href="http://www.patterndepot.com/put/8/visitor.pdf">link </a> describes the
23 * Visitor pattern in detail.
24 * </p>
25 *
26 * @author <a href="mailto:james.strachan@metastuff.com">James Strachan </a>
27 * @version $Revision: 1.8 $
28 */
29 public interface Visitor {
30 /***
31 * <p>
32 * Visits the given <code>Document</code>
33 * </p>
34 *
35 * @param document
36 * is the <code>Document</code> node to visit.
37 */
38 void visit(Document document);
39
40 /***
41 * <p>
42 * Visits the given <code>DocumentType</code>
43 * </p>
44 *
45 * @param documentType
46 * is the <code>DocumentType</code> node to visit.
47 */
48 void visit(DocumentType documentType);
49
50 /***
51 * <p>
52 * Visits the given <code>Element</code>
53 * </p>
54 *
55 * @param node
56 * is the <code>Element</code> node to visit.
57 */
58 void visit(Element node);
59
60 /***
61 * <p>
62 * Visits the given <code>Attribute</code>
63 * </p>
64 *
65 * @param node
66 * is the <code>Attribute</code> node to visit.
67 */
68 void visit(Attribute node);
69
70 /***
71 * <p>
72 * Visits the given <code>CDATA</code>
73 * </p>
74 *
75 * @param node
76 * is the <code>CDATA</code> node to visit.
77 */
78 void visit(CDATA node);
79
80 /***
81 * <p>
82 * Visits the given <code>Comment</code>
83 * </p>
84 *
85 * @param node
86 * is the <code>Comment</code> node to visit.
87 */
88 void visit(Comment node);
89
90 /***
91 * <p>
92 * Visits the given <code>Entity</code>
93 * </p>
94 *
95 * @param node
96 * is the <code>Entity</code> node to visit.
97 */
98 void visit(Entity node);
99
100 /***
101 * <p>
102 * Visits the given <code>Namespace</code>
103 * </p>
104 *
105 * @param namespace
106 * is the <code>Namespace</code> node to visit.
107 */
108 void visit(Namespace namespace);
109
110 /***
111 * <p>
112 * Visits the given <code>ProcessingInstruction</code>
113 * </p>
114 *
115 * @param node
116 * is the <code>ProcessingInstruction</code> node to visit.
117 */
118 void visit(ProcessingInstruction node);
119
120 /***
121 * <p>
122 * Visits the given <code>Text</code>
123 * </p>
124 *
125 * @param node
126 * is the <code>Text</code> node to visit.
127 */
128 void visit(Text node);
129 }
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166