KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > corext > dom > GenericVisitor


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.corext.dom;
12
13 import org.eclipse.jdt.core.dom.*;
14
15 public class GenericVisitor extends ASTVisitor {
16     
17     public GenericVisitor() {
18         super();
19     }
20
21     /**
22      * @param visitJavadocTags <code>true</code> if doc comment tags are
23      * to be visited by default, and <code>false</code> otherwise
24      * @see Javadoc#tags()
25      * @see #visit(Javadoc)
26      * @since 3.0
27      */

28     public GenericVisitor(boolean visitJavadocTags) {
29         super(visitJavadocTags);
30     }
31     
32     //---- Hooks for subclasses -------------------------------------------------
33

34     protected boolean visitNode(ASTNode node) {
35         return true;
36     }
37     
38     protected void endVisitNode(ASTNode node) {
39         // do nothing
40
}
41
42     public boolean visit(AnonymousClassDeclaration node) {
43         return visitNode(node);
44     }
45     public boolean visit(ArrayAccess node) {
46         return visitNode(node);
47     }
48     public boolean visit(ArrayCreation node) {
49         return visitNode(node);
50     }
51     public boolean visit(ArrayInitializer node) {
52         return visitNode(node);
53     }
54     public boolean visit(ArrayType node) {
55         return visitNode(node);
56     }
57     public boolean visit(AssertStatement node) {
58         return visitNode(node);
59     }
60     public boolean visit(Assignment node) {
61         return visitNode(node);
62     }
63     public boolean visit(Block node) {
64         return visitNode(node);
65     }
66     public boolean visit(BooleanLiteral node) {
67         return visitNode(node);
68     }
69     public boolean visit(BreakStatement node) {
70         return visitNode(node);
71     }
72     public boolean visit(CastExpression node) {
73         return visitNode(node);
74     }
75     public boolean visit(CatchClause node) {
76         return visitNode(node);
77     }
78     public boolean visit(CharacterLiteral node) {
79         return visitNode(node);
80     }
81     public boolean visit(ClassInstanceCreation node) {
82         return visitNode(node);
83     }
84     public boolean visit(CompilationUnit node) {
85         return visitNode(node);
86     }
87     public boolean visit(ConditionalExpression node) {
88         return visitNode(node);
89     }
90     public boolean visit(ConstructorInvocation node) {
91         return visitNode(node);
92     }
93     public boolean visit(ContinueStatement node) {
94         return visitNode(node);
95     }
96     public boolean visit(DoStatement node) {
97         return visitNode(node);
98     }
99     public boolean visit(EmptyStatement node) {
100         return visitNode(node);
101     }
102     public boolean visit(ExpressionStatement node) {
103         return visitNode(node);
104     }
105     public boolean visit(FieldAccess node) {
106         return visitNode(node);
107     }
108     public boolean visit(FieldDeclaration node) {
109         return visitNode(node);
110     }
111     public boolean visit(ForStatement node) {
112         return visitNode(node);
113     }
114     public boolean visit(IfStatement node) {
115         return visitNode(node);
116     }
117     public boolean visit(ImportDeclaration node) {
118         return visitNode(node);
119     }
120     public boolean visit(InfixExpression node) {
121         return visitNode(node);
122     }
123     public boolean visit(InstanceofExpression node) {
124         return visitNode(node);
125     }
126     public boolean visit(Initializer node) {
127         return visitNode(node);
128     }
129     public boolean visit(Javadoc node) {
130         if (super.visit(node))
131             return visitNode(node);
132         else
133             return false;
134     }
135     public boolean visit(LabeledStatement node) {
136         return visitNode(node);
137     }
138     public boolean visit(MethodDeclaration node) {
139         return visitNode(node);
140     }
141     public boolean visit(MethodInvocation node) {
142         return visitNode(node);
143     }
144     public boolean visit(NullLiteral node) {
145         return visitNode(node);
146     }
147     public boolean visit(NumberLiteral node) {
148         return visitNode(node);
149     }
150     public boolean visit(PackageDeclaration node) {
151         return visitNode(node);
152     }
153     public boolean visit(ParenthesizedExpression node) {
154         return visitNode(node);
155     }
156     public boolean visit(PostfixExpression node) {
157         return visitNode(node);
158     }
159     public boolean visit(PrefixExpression node) {
160         return visitNode(node);
161     }
162     public boolean visit(PrimitiveType node) {
163         return visitNode(node);
164     }
165     public boolean visit(QualifiedName node) {
166         return visitNode(node);
167     }
168     public boolean visit(ReturnStatement node) {
169         return visitNode(node);
170     }
171     public boolean visit(SimpleName node) {
172         return visitNode(node);
173     }
174     public boolean visit(SimpleType node) {
175         return visitNode(node);
176     }
177     public boolean visit(StringLiteral node) {
178         return visitNode(node);
179     }
180     public boolean visit(SuperConstructorInvocation node) {
181         return visitNode(node);
182     }
183     public boolean visit(SuperFieldAccess node) {
184         return visitNode(node);
185     }
186     public boolean visit(SuperMethodInvocation node) {
187         return visitNode(node);
188     }
189     public boolean visit(SwitchCase node) {
190         return visitNode(node);
191     }
192     public boolean visit(SwitchStatement node) {
193         return visitNode(node);
194     }
195     public boolean visit(SynchronizedStatement node) {
196         return visitNode(node);
197     }
198     public boolean visit(ThisExpression node) {
199         return visitNode(node);
200     }
201     public boolean visit(ThrowStatement node) {
202         return visitNode(node);
203     }
204     public boolean visit(TryStatement node) {
205         return visitNode(node);
206     }
207     public boolean visit(TypeDeclaration node) {
208         return visitNode(node);
209     }
210     public boolean visit(TypeDeclarationStatement node) {
211         return visitNode(node);
212     }
213     public boolean visit(TypeLiteral node) {
214         return visitNode(node);
215     }
216     public boolean visit(SingleVariableDeclaration node) {
217         return visitNode(node);
218     }
219     public boolean visit(VariableDeclarationExpression node) {
220         return visitNode(node);
221     }
222     public boolean visit(VariableDeclarationStatement node) {
223         return visitNode(node);
224     }
225     public boolean visit(VariableDeclarationFragment node) {
226         return visitNode(node);
227     }
228     public boolean visit(WhileStatement node) {
229         return visitNode(node);
230     }
231
232     /* (non-Javadoc)
233      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.AnnotationTypeDeclaration)
234      */

235     public boolean visit(AnnotationTypeDeclaration node) {
236         return visitNode(node);
237     }
238     /* (non-Javadoc)
239      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.AnnotationTypeMemberDeclaration)
240      */

241     public boolean visit(AnnotationTypeMemberDeclaration node) {
242         return visitNode(node);
243     }
244     /* (non-Javadoc)
245      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.BlockComment)
246      */

247     public boolean visit(BlockComment node) {
248         return visitNode(node);
249     }
250     /* (non-Javadoc)
251      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.EnhancedForStatement)
252      */

253     public boolean visit(EnhancedForStatement node) {
254         return visitNode(node);
255     }
256     /* (non-Javadoc)
257      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.EnumConstantDeclaration)
258      */

259     public boolean visit(EnumConstantDeclaration node) {
260         return visitNode(node);
261     }
262     /* (non-Javadoc)
263      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.EnumDeclaration)
264      */

265     public boolean visit(EnumDeclaration node) {
266         return visitNode(node);
267     }
268     /* (non-Javadoc)
269      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.LineComment)
270      */

271     public boolean visit(LineComment node) {
272         return visitNode(node);
273     }
274     /* (non-Javadoc)
275      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MarkerAnnotation)
276      */

277     public boolean visit(MarkerAnnotation node) {
278         return visitNode(node);
279     }
280     /* (non-Javadoc)
281      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MemberRef)
282      */

283     public boolean visit(MemberRef node) {
284         return visitNode(node);
285     }
286     /* (non-Javadoc)
287      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MemberValuePair)
288      */

289     public boolean visit(MemberValuePair node) {
290         return visitNode(node);
291     }
292     /* (non-Javadoc)
293      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MethodRef)
294      */

295     public boolean visit(MethodRef node) {
296         return visitNode(node);
297     }
298     /* (non-Javadoc)
299      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.MethodRefParameter)
300      */

301     public boolean visit(MethodRefParameter node) {
302         return visitNode(node);
303     }
304     /* (non-Javadoc)
305      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.Modifier)
306      */

307     public boolean visit(Modifier node) {
308         return visitNode(node);
309     }
310     /* (non-Javadoc)
311      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.NormalAnnotation)
312      */

313     public boolean visit(NormalAnnotation node) {
314         return visitNode(node);
315     }
316     /* (non-Javadoc)
317      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.ParameterizedType)
318      */

319     public boolean visit(ParameterizedType node) {
320         return visitNode(node);
321     }
322     /* (non-Javadoc)
323      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.QualifiedType)
324      */

325     public boolean visit(QualifiedType node) {
326         return visitNode(node);
327     }
328     /* (non-Javadoc)
329      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.SingleMemberAnnotation)
330      */

331     public boolean visit(SingleMemberAnnotation node) {
332         return visitNode(node);
333     }
334     /* (non-Javadoc)
335      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TagElement)
336      */

337     public boolean visit(TagElement node) {
338         return visitNode(node);
339     }
340     /* (non-Javadoc)
341      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TextElement)
342      */

343     public boolean visit(TextElement node) {
344         return visitNode(node);
345     }
346     /* (non-Javadoc)
347      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TypeParameter)
348      */

349     public boolean visit(TypeParameter node) {
350         return visitNode(node);
351     }
352     /* (non-Javadoc)
353      * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.WildcardType)
354      */

355     public boolean visit(WildcardType node) {
356         return visitNode(node);
357     }
358     
359     public void endVisit(AnonymousClassDeclaration node) {
360         endVisitNode(node);
361     }
362     public void endVisit(ArrayAccess node) {
363         endVisitNode(node);
364     }
365     public void endVisit(ArrayCreation node) {
366         endVisitNode(node);
367     }
368     public void endVisit(ArrayInitializer node) {
369         endVisitNode(node);
370     }
371     public void endVisit(ArrayType node) {
372         endVisitNode(node);
373     }
374     public void endVisit(AssertStatement node) {
375         endVisitNode(node);
376     }
377     public void endVisit(Assignment node) {
378         endVisitNode(node);
379     }
380     public void endVisit(Block node) {
381         endVisitNode(node);
382     }
383     public void endVisit(BooleanLiteral node) {
384         endVisitNode(node);
385     }
386     public void endVisit(BreakStatement node) {
387         endVisitNode(node);
388     }
389     public void endVisit(CastExpression node) {
390         endVisitNode(node);
391     }
392     public void endVisit(CatchClause node) {
393         endVisitNode(node);
394     }
395     public void endVisit(CharacterLiteral node) {
396         endVisitNode(node);
397     }
398     public void endVisit(ClassInstanceCreation node) {
399         endVisitNode(node);
400     }
401     public void endVisit(CompilationUnit node) {
402         endVisitNode(node);
403     }
404     public void endVisit(ConditionalExpression node) {
405         endVisitNode(node);
406     }
407     public void endVisit(ConstructorInvocation node) {
408         endVisitNode(node);
409     }
410     public void endVisit(ContinueStatement node) {
411         endVisitNode(node);
412     }
413     public void endVisit(DoStatement node) {
414         endVisitNode(node);
415     }
416     public void endVisit(EmptyStatement node) {
417         endVisitNode(node);
418     }
419     public void endVisit(ExpressionStatement node) {
420         endVisitNode(node);
421     }
422     public void endVisit(FieldAccess node) {
423         endVisitNode(node);
424     }
425     public void endVisit(FieldDeclaration node) {
426         endVisitNode(node);
427     }
428     public void endVisit(ForStatement node) {
429         endVisitNode(node);
430     }
431     public void endVisit(IfStatement node) {
432         endVisitNode(node);
433     }
434     public void endVisit(ImportDeclaration node) {
435         endVisitNode(node);
436     }
437     public void endVisit(InfixExpression node) {
438         endVisitNode(node);
439     }
440     public void endVisit(InstanceofExpression node) {
441         endVisitNode(node);
442     }
443     public void endVisit(Initializer node) {
444         endVisitNode(node);
445     }
446     public void endVisit(Javadoc node) {
447         endVisitNode(node);
448     }
449     public void endVisit(LabeledStatement node) {
450         endVisitNode(node);
451     }
452     public void endVisit(MethodDeclaration node) {
453         endVisitNode(node);
454     }
455     public void endVisit(MethodInvocation node) {
456         endVisitNode(node);
457     }
458     public void endVisit(NullLiteral node) {
459         endVisitNode(node);
460     }
461     public void endVisit(NumberLiteral node) {
462         endVisitNode(node);
463     }
464     public void endVisit(PackageDeclaration node) {
465         endVisitNode(node);
466     }
467     public void endVisit(ParenthesizedExpression node) {
468         endVisitNode(node);
469     }
470     public void endVisit(PostfixExpression node) {
471         endVisitNode(node);
472     }
473     public void endVisit(PrefixExpression node) {
474         endVisitNode(node);
475     }
476     public void endVisit(PrimitiveType node) {
477         endVisitNode(node);
478     }
479     public void endVisit(QualifiedName node) {
480         endVisitNode(node);
481     }
482     public void endVisit(ReturnStatement node) {
483         endVisitNode(node);
484     }
485     public void endVisit(SimpleName node) {
486         endVisitNode(node);
487     }
488     public void endVisit(SimpleType node) {
489         endVisitNode(node);
490     }
491     public void endVisit(StringLiteral node) {
492         endVisitNode(node);
493     }
494     public void endVisit(SuperConstructorInvocation node) {
495         endVisitNode(node);
496     }
497     public void endVisit(SuperFieldAccess node) {
498         endVisitNode(node);
499     }
500     public void endVisit(SuperMethodInvocation node) {
501         endVisitNode(node);
502     }
503     public void endVisit(SwitchCase node) {
504         endVisitNode(node);
505     }
506     public void endVisit(SwitchStatement node) {
507         endVisitNode(node);
508     }
509     public void endVisit(SynchronizedStatement node) {
510         endVisitNode(node);
511     }
512     public void endVisit(ThisExpression node) {
513         endVisitNode(node);
514     }
515     public void endVisit(ThrowStatement node) {
516         endVisitNode(node);
517     }
518     public void endVisit(TryStatement node) {
519         endVisitNode(node);
520     }
521     public void endVisit(TypeDeclaration node) {
522         endVisitNode(node);
523     }
524     public void endVisit(TypeDeclarationStatement node) {
525         endVisitNode(node);
526     }
527     public void endVisit(TypeLiteral node) {
528         endVisitNode(node);
529     }
530     public void endVisit(SingleVariableDeclaration node) {
531         endVisitNode(node);
532     }
533     public void endVisit(VariableDeclarationExpression node) {
534         endVisitNode(node);
535     }
536     public void endVisit(VariableDeclarationStatement node) {
537         endVisitNode(node);
538     }
539     public void endVisit(VariableDeclarationFragment node) {
540         endVisitNode(node);
541     }
542     public void endVisit(WhileStatement node) {
543         endVisitNode(node);
544     }
545
546     
547     /* (non-Javadoc)
548      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.AnnotationTypeDeclaration)
549      */

550     public void endVisit(AnnotationTypeDeclaration node) {
551         endVisitNode(node);
552     }
553     /* (non-Javadoc)
554      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.AnnotationTypeMemberDeclaration)
555      */

556     public void endVisit(AnnotationTypeMemberDeclaration node) {
557         endVisitNode(node);
558     }
559     /* (non-Javadoc)
560      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.BlockComment)
561      */

562     public void endVisit(BlockComment node) {
563         endVisitNode(node);
564     }
565     /* (non-Javadoc)
566      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.EnhancedForStatement)
567      */

568     public void endVisit(EnhancedForStatement node) {
569         endVisitNode(node);
570     }
571     /* (non-Javadoc)
572      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.EnumConstantDeclaration)
573      */

574     public void endVisit(EnumConstantDeclaration node) {
575         endVisitNode(node);
576     }
577     /* (non-Javadoc)
578      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.EnumDeclaration)
579      */

580     public void endVisit(EnumDeclaration node) {
581         endVisitNode(node);
582     }
583     /* (non-Javadoc)
584      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.LineComment)
585      */

586     public void endVisit(LineComment node) {
587         endVisitNode(node);
588     }
589     /* (non-Javadoc)
590      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.MarkerAnnotation)
591      */

592     public void endVisit(MarkerAnnotation node) {
593         endVisitNode(node);
594     }
595     /* (non-Javadoc)
596      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.MemberRef)
597      */

598     public void endVisit(MemberRef node) {
599         endVisitNode(node);
600     }
601     /* (non-Javadoc)
602      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.MemberValuePair)
603      */

604     public void endVisit(MemberValuePair node) {
605         endVisitNode(node);
606     }
607     /* (non-Javadoc)
608      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.MethodRef)
609      */

610     public void endVisit(MethodRef node) {
611         endVisitNode(node);
612     }
613     /* (non-Javadoc)
614      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.MethodRefParameter)
615      */

616     public void endVisit(MethodRefParameter node) {
617         endVisitNode(node);
618     }
619     /* (non-Javadoc)
620      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.Modifier)
621      */

622     public void endVisit(Modifier node) {
623         endVisitNode(node);
624     }
625     /* (non-Javadoc)
626      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.NormalAnnotation)
627      */

628     public void endVisit(NormalAnnotation node) {
629         endVisitNode(node);
630     }
631     /* (non-Javadoc)
632      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.ParameterizedType)
633      */

634     public void endVisit(ParameterizedType node) {
635         endVisitNode(node);
636     }
637     /* (non-Javadoc)
638      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.QualifiedType)
639      */

640     public void endVisit(QualifiedType node) {
641         endVisitNode(node);
642     }
643     /* (non-Javadoc)
644      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.SingleMemberAnnotation)
645      */

646     public void endVisit(SingleMemberAnnotation node) {
647         endVisitNode(node);
648     }
649     /* (non-Javadoc)
650      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.TagElement)
651      */

652     public void endVisit(TagElement node) {
653         endVisitNode(node);
654     }
655     /* (non-Javadoc)
656      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.TextElement)
657      */

658     public void endVisit(TextElement node) {
659         endVisitNode(node);
660     }
661     /* (non-Javadoc)
662      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.TypeParameter)
663      */

664     public void endVisit(TypeParameter node) {
665         endVisitNode(node);
666     }
667     /* (non-Javadoc)
668      * @see org.eclipse.jdt.core.dom.ASTVisitor#endVisit(org.eclipse.jdt.core.dom.WildcardType)
669      */

670     public void endVisit(WildcardType node) {
671         endVisitNode(node);
672     }
673
674 }
675
Popular Tags