001: /*
002: * @(#)DeclarationVisitor.java 1.3 04/04/20
003: *
004: * Copyright (c) 2004, Sun Microsystems, Inc.
005: * All rights reserved.
006: *
007: * Redistribution and use in source and binary forms, with or without
008: * modification, are permitted provided that the following conditions are met:
009: *
010: * * Redistributions of source code must retain the above copyright
011: * notice, this list of conditions and the following disclaimer.
012: * * Redistributions in binary form must reproduce the above copyright
013: * notice, this list of conditions and the following disclaimer in the
014: * documentation and/or other materials provided with the distribution.
015: * * Neither the name of the Sun Microsystems, Inc. nor the names of
016: * its contributors may be used to endorse or promote products derived from
017: * this software without specific prior written permission.
018: *
019: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
020: * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
021: * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
022: * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
023: * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
024: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
025: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
026: * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
027: * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
028: * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
029: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
030: */
031:
032: package com.sun.mirror.util;
033:
034: import com.sun.mirror.declaration.*;
035:
036: /**
037: * A visitor for declarations, in the style of the standard visitor
038: * design pattern. Classes implementing this interface are used to
039: * operate on a declaration when the kind of declaration is unknown at
040: * compile time. When a visitor is passed to a declaration's {@link
041: * Declaration#accept accept} method, the most specific
042: * <tt>visit<i>Xxx</i></tt> method applicable to that declaration is
043: * invoked.
044: *
045: * @author Joseph D. Darcy
046: * @author Scott Seligman
047: * @version 1.3 04/04/20
048: * @since 1.5
049: */
050:
051: public interface DeclarationVisitor {
052:
053: /**
054: * Visits a declaration.
055: * @param d the declaration to visit
056: */
057: public void visitDeclaration(Declaration d);
058:
059: /**
060: * Visits a package declaration.
061: * @param d the declaration to visit
062: */
063: public void visitPackageDeclaration(PackageDeclaration d);
064:
065: /**
066: * Visits a member or constructor declaration.
067: * @param d the declaration to visit
068: */
069: public void visitMemberDeclaration(MemberDeclaration d);
070:
071: /**
072: * Visits a type declaration.
073: * @param d the declaration to visit
074: */
075: public void visitTypeDeclaration(TypeDeclaration d);
076:
077: /**
078: * Visits a class declaration.
079: * @param d the declaration to visit
080: */
081: public void visitClassDeclaration(ClassDeclaration d);
082:
083: /**
084: * Visits an enum declaration.
085: * @param d the declaration to visit
086: */
087: public void visitEnumDeclaration(EnumDeclaration d);
088:
089: /**
090: * Visits an interface declaration.
091: * @param d the declaration to visit
092: */
093: public void visitInterfaceDeclaration(InterfaceDeclaration d);
094:
095: /**
096: * Visits an annotation type declaration.
097: * @param d the declaration to visit
098: */
099: public void visitAnnotationTypeDeclaration(
100: AnnotationTypeDeclaration d);
101:
102: /**
103: * Visits a field declaration.
104: * @param d the declaration to visit
105: */
106: public void visitFieldDeclaration(FieldDeclaration d);
107:
108: /**
109: * Visits an enum constant declaration.
110: * @param d the declaration to visit
111: */
112: public void visitEnumConstantDeclaration(EnumConstantDeclaration d);
113:
114: /**
115: * Visits a method or constructor declaration.
116: * @param d the declaration to visit
117: */
118: public void visitExecutableDeclaration(ExecutableDeclaration d);
119:
120: /**
121: * Visits a constructor declaration.
122: * @param d the declaration to visit
123: */
124: public void visitConstructorDeclaration(ConstructorDeclaration d);
125:
126: /**
127: * Visits a method declaration.
128: * @param d the declaration to visit
129: */
130: public void visitMethodDeclaration(MethodDeclaration d);
131:
132: /**
133: * Visits an annotation type element declaration.
134: * @param d the declaration to visit
135: */
136: public void visitAnnotationTypeElementDeclaration(
137: AnnotationTypeElementDeclaration d);
138:
139: /**
140: * Visits a parameter declaration.
141: * @param d the declaration to visit
142: */
143: public void visitParameterDeclaration(ParameterDeclaration d);
144:
145: /**
146: * Visits a type parameter declaration.
147: * @param d the declaration to visit
148: */
149: public void visitTypeParameterDeclaration(TypeParameterDeclaration d);
150: }
|