KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > spoon > reflect > visitor > CtVisitor


1 package spoon.reflect.visitor;
2
3 import java.lang.annotation.Annotation JavaDoc;
4
5 import spoon.reflect.code.CtArrayAccess;
6 import spoon.reflect.code.CtAssert;
7 import spoon.reflect.code.CtAssignment;
8 import spoon.reflect.code.CtBinaryOperator;
9 import spoon.reflect.code.CtBlock;
10 import spoon.reflect.code.CtBreak;
11 import spoon.reflect.code.CtCase;
12 import spoon.reflect.code.CtCatch;
13 import spoon.reflect.code.CtConditional;
14 import spoon.reflect.code.CtContinue;
15 import spoon.reflect.code.CtDo;
16 import spoon.reflect.code.CtExpression;
17 import spoon.reflect.code.CtFieldAccess;
18 import spoon.reflect.code.CtFor;
19 import spoon.reflect.code.CtForEach;
20 import spoon.reflect.code.CtIf;
21 import spoon.reflect.code.CtInvocation;
22 import spoon.reflect.code.CtLiteral;
23 import spoon.reflect.code.CtLocalVariable;
24 import spoon.reflect.code.CtNewArray;
25 import spoon.reflect.code.CtNewClass;
26 import spoon.reflect.code.CtOperatorAssignment;
27 import spoon.reflect.code.CtReturn;
28 import spoon.reflect.code.CtStatementList;
29 import spoon.reflect.code.CtSwitch;
30 import spoon.reflect.code.CtSynchronized;
31 import spoon.reflect.code.CtThrow;
32 import spoon.reflect.code.CtTry;
33 import spoon.reflect.code.CtUnaryOperator;
34 import spoon.reflect.code.CtVariableAccess;
35 import spoon.reflect.code.CtWhile;
36 import spoon.reflect.declaration.CtAnnotation;
37 import spoon.reflect.declaration.CtAnnotationType;
38 import spoon.reflect.declaration.CtAnonymousExecutable;
39 import spoon.reflect.declaration.CtClass;
40 import spoon.reflect.declaration.CtConstructor;
41 import spoon.reflect.declaration.CtEnum;
42 import spoon.reflect.declaration.CtField;
43 import spoon.reflect.declaration.CtInterface;
44 import spoon.reflect.declaration.CtMethod;
45 import spoon.reflect.declaration.CtPackage;
46 import spoon.reflect.declaration.CtParameter;
47 import spoon.reflect.declaration.CtTypeParameter;
48 import spoon.reflect.reference.CtArrayTypeReference;
49 import spoon.reflect.reference.CtExecutableReference;
50 import spoon.reflect.reference.CtFieldReference;
51 import spoon.reflect.reference.CtLocalVariableReference;
52 import spoon.reflect.reference.CtPackageReference;
53 import spoon.reflect.reference.CtParameterReference;
54 import spoon.reflect.reference.CtTypeParameterReference;
55 import spoon.reflect.reference.CtTypeReference;
56
57 /**
58  * This interface defines the visitor for the Spoon metamodel, as defined in
59  * {@link spoon.reflect.declaration}, {@link spoon.reflect.code}, and
60  * {@link spoon.reflect.reference}.
61  */

62 public interface CtVisitor {
63     /**
64      * Visits an annotation.
65      */

66     <A extends Annotation JavaDoc> void visitCtAnnotation(CtAnnotation<A> annotation);
67
68     /**
69      * Visits an annotation type declaration.
70      */

71     <A extends Annotation JavaDoc> void visitCtAnnotationType(
72             CtAnnotationType<A> annotationType);
73
74     /**
75      * Visits an anonymous executable.
76      */

77     void visitCtAnonymousExecutable(CtAnonymousExecutable anonymousExec);
78
79     /**
80      * Visits an array access.
81      */

82     <T, E extends CtExpression<?>> void visitCtArrayAccess(
83             CtArrayAccess<T, E> arrayAccess);
84
85     /**
86      * Visits a reference to an array type.
87      */

88     <T> void visitCtArrayTypeReference(CtArrayTypeReference<T> reference);
89
90     /**
91      * Visits an assert.
92      */

93     <T> void visitCtAssert(CtAssert<T> asserted);
94
95     /**
96      * Visits an assignment.
97      */

98     <T, A extends T> void visitCtAssignment(CtAssignment<T, A> assignement);
99
100     /**
101      * Visits a binary operator.
102      */

103     <T> void visitCtBinaryOperator(CtBinaryOperator<T> operator);
104
105     /**
106      * Visits a block of code.
107      */

108     <R> void visitCtBlock(CtBlock<R> block);
109
110     /**
111      * Visits a <code>break</code> statement.
112      */

113     void visitCtBreak(CtBreak breakStatement);
114
115     /**
116      * Visits a <code>case</code> clause.
117      */

118     <S> void visitCtCase(CtCase<S> caseStatement);
119
120     /**
121      * Visits a <code>catch</code> clause.
122      */

123     void visitCtCatch(CtCatch catchBlock);
124
125     /**
126      * Visits a class declaration.
127      */

128     <T> void visitCtClass(CtClass<T> ctClass);
129
130     /**
131      * Visits a conditional expression
132      */

133     <T> void visitCtConditional(CtConditional<T> conditional);
134
135     /**
136      * Visits a constructor declaration.
137      */

138     <T> void visitCtConstructor(CtConstructor<T> c);
139
140     /**
141      * Visits a <code>continue</code> statement.
142      */

143     void visitCtContinue(CtContinue continueStatement);
144
145     /**
146      * Visits a <code>do</code> loop.
147      */

148     void visitCtDo(CtDo doLoop);
149
150     /**
151      * Visits an enumeration declaration.
152      */

153     <T extends Enum JavaDoc> void visitCtEnum(CtEnum<T> ctEnum);
154
155     /**
156      * Visits a reference to an executable.
157      */

158     <T> void visitCtExecutableReference(CtExecutableReference<T> reference);
159
160     /**
161      * Visits a field declaration.
162      */

163     <T> void visitCtField(CtField<T> f);
164
165     /**
166      * Visits a field access.
167      */

168     <T> void visitCtFieldAccess(CtFieldAccess<T> fieldAccess);
169
170     /**
171      * Visits a reference to a field.
172      */

173     <T> void visitCtFieldReference(CtFieldReference<T> reference);
174
175     /**
176      * Visits a <code>for</code> loop.
177      */

178     void visitCtFor(CtFor forLoop);
179
180     /**
181      * Visits an enhanced <code>for</code> loop.
182      */

183     void visitCtForEach(CtForEach foreach);
184
185     /**
186      * Visits an <code>if</code> statement.
187      */

188     void visitCtIf(CtIf ifElement);
189
190     /**
191      * Visits an interface declaration.
192      */

193     <T> void visitCtInterface(CtInterface<T> intrface);
194
195     /**
196      * Visits an executable invocation.
197      */

198     <T> void visitCtInvocation(CtInvocation<T> invocation);
199
200     /**
201      * Visits a literal expression.
202      */

203     <T> void visitCtLiteral(CtLiteral<T> literal);
204
205     /**
206      * Visits a local variable declaration.
207      */

208     <T> void visitCtLocalVariable(CtLocalVariable<T> localVariable);
209
210     /**
211      * Visits a reference to a local variable.
212      */

213     <T> void visitCtLocalVariableReference(CtLocalVariableReference<T> reference);
214
215     /**
216      * Visits a method declaration.
217      */

218     <T> void visitCtMethod(CtMethod<T> m);
219
220     /**
221      * Visits an array construction.
222      */

223     <T> void visitCtNewArray(CtNewArray<T> newArray);
224
225     /**
226      * Visits an anonymous class construction.
227      */

228     <T> void visitCtNewClass(CtNewClass<T> newClass);
229
230     /**
231      * Visits an operator assignment.
232      */

233     <T, A extends T> void visitCtOperatorAssignement(
234             CtOperatorAssignment<T, A> assignment);
235
236     /**
237      * Visits a package declaration.
238      */

239     void visitCtPackage(CtPackage ctPackage);
240
241     /**
242      * Visits a reference to a package.
243      */

244     void visitCtPackageReference(CtPackageReference reference);
245
246     /**
247      * Visits a parameter declaration.
248      */

249     <T> void visitCtParameter(CtParameter<T> parameter);
250
251     /**
252      * Visits a reference to a parameter.
253      */

254     <T> void visitCtParameterReference(CtParameterReference<T> reference);
255
256     /**
257      * Visits a <code>return</code> statement.
258      */

259     <R> void visitCtReturn(CtReturn<R> returnStatement);
260
261     /**
262      * Visits a statement list.
263      */

264     <R> void visitCtStatementList(CtStatementList<R> statements);
265
266     /**
267      * Visits a <code>switch</code> statement.
268      */

269     <S> void visitCtSwitch(CtSwitch<S> switchStatement);
270
271     /**
272      * Visits a <code>synchronized</code> modifier.
273      */

274     void visitCtSynchronized(CtSynchronized synchro);
275
276     /**
277      * Visits a <code>throw</code> statement.
278      */

279     void visitCtThrow(CtThrow throwStatement);
280
281     /**
282      * Visits a <code>try</code> statement.
283      */

284     void visitCtTry(CtTry tryBlock);
285
286     /**
287      * Visits a type parameter declaration.
288      */

289     void visitCtTypeParameter(CtTypeParameter typeParameter);
290
291     /**
292      * Visits a reference to a type parameter.
293      */

294     void visitCtTypeParameterReference(CtTypeParameterReference ref);
295
296     /**
297      * Visits a reference to a type.
298      */

299     <T> void visitCtTypeReference(CtTypeReference<T> reference);
300
301     /**
302      * Visits a unary operator.
303      */

304     <T> void visitCtUnaryOperator(CtUnaryOperator<T> operator);
305
306     /**
307      * Visits a variable access.
308      */

309     <T> void visitCtVariableAccess(CtVariableAccess<T> variableAccess);
310
311     /**
312      * Visits a <code>while</code> loop.
313      */

314     void visitCtWhile(CtWhile whileLoop);
315
316 }
Popular Tags