KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > mirror > util > DeclarationVisitor


1 /*
2  * @(#)DeclarationVisitor.java 1.3 04/04/20
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.mirror.util;
9
10 import com.sun.mirror.declaration.*;
11
12
13 /**
14  * A visitor for declarations, in the style of the standard visitor
15  * design pattern. Classes implementing this interface are used to
16  * operate on a declaration when the kind of declaration is unknown at
17  * compile time. When a visitor is passed to a declaration's {@link
18  * Declaration#accept accept} method, the most specific
19  * <tt>visit<i>Xxx</i></tt> method applicable to that declaration is
20  * invoked.
21  *
22  * @author Joseph D. Darcy
23  * @author Scott Seligman
24  * @version 1.3 04/04/20
25  * @since 1.5
26  */

27
28 public interface DeclarationVisitor {
29
30     /**
31      * Visits a declaration.
32      * @param d the declaration to visit
33      */

34     public void visitDeclaration(Declaration d);
35
36     /**
37      * Visits a package declaration.
38      * @param d the declaration to visit
39      */

40     public void visitPackageDeclaration(PackageDeclaration d);
41
42     /**
43      * Visits a member or constructor declaration.
44      * @param d the declaration to visit
45      */

46     public void visitMemberDeclaration(MemberDeclaration d);
47
48     /**
49      * Visits a type declaration.
50      * @param d the declaration to visit
51      */

52     public void visitTypeDeclaration(TypeDeclaration d);
53
54     /**
55      * Visits a class declaration.
56      * @param d the declaration to visit
57      */

58     public void visitClassDeclaration(ClassDeclaration d);
59
60     /**
61      * Visits an enum declaration.
62      * @param d the declaration to visit
63      */

64     public void visitEnumDeclaration(EnumDeclaration d);
65
66     /**
67      * Visits an interface declaration.
68      * @param d the declaration to visit
69      */

70     public void visitInterfaceDeclaration(InterfaceDeclaration d);
71
72     /**
73      * Visits an annotation type declaration.
74      * @param d the declaration to visit
75      */

76     public void visitAnnotationTypeDeclaration(AnnotationTypeDeclaration d);
77
78     /**
79      * Visits a field declaration.
80      * @param d the declaration to visit
81      */

82     public void visitFieldDeclaration(FieldDeclaration d);
83
84     /**
85      * Visits an enum constant declaration.
86      * @param d the declaration to visit
87      */

88     public void visitEnumConstantDeclaration(EnumConstantDeclaration d);
89
90     /**
91      * Visits a method or constructor declaration.
92      * @param d the declaration to visit
93      */

94     public void visitExecutableDeclaration(ExecutableDeclaration d);
95
96     /**
97      * Visits a constructor declaration.
98      * @param d the declaration to visit
99      */

100     public void visitConstructorDeclaration(ConstructorDeclaration d);
101
102     /**
103      * Visits a method declaration.
104      * @param d the declaration to visit
105      */

106     public void visitMethodDeclaration(MethodDeclaration d);
107
108     /**
109      * Visits an annotation type element declaration.
110      * @param d the declaration to visit
111      */

112     public void visitAnnotationTypeElementDeclaration(
113                      AnnotationTypeElementDeclaration d);
114
115     /**
116      * Visits a parameter declaration.
117      * @param d the declaration to visit
118      */

119     public void visitParameterDeclaration(ParameterDeclaration d);
120
121     /**
122      * Visits a type parameter declaration.
123      * @param d the declaration to visit
124      */

125     public void visitTypeParameterDeclaration(TypeParameterDeclaration d);
126 }
127
Popular Tags