001: /*
002: * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: package com.sun.mirror.util;
027:
028: import com.sun.mirror.type.*;
029:
030: /**
031: * A visitor for types, in the style of the standard visitor design pattern.
032: * This is used to operate on a type when the kind
033: * of type is unknown at compile time.
034: * When a visitor is passed to a type's
035: * {@link TypeMirror#accept accept} method,
036: * the most specific <tt>visit<i>Xxx</i></tt> method applicable to
037: * that type is invoked.
038: *
039: * @author Joseph D. Darcy
040: * @author Scott Seligman
041: * @version 1.11 07/05/05
042: * @since 1.5
043: */
044:
045: public interface TypeVisitor {
046:
047: /**
048: * Visits a type mirror.
049: *
050: * @param t the type to visit
051: */
052: public void visitTypeMirror(TypeMirror t);
053:
054: /**
055: * Visits a primitive type.
056:
057: * @param t the type to visit
058: */
059: public void visitPrimitiveType(PrimitiveType t);
060:
061: /**
062: * Visits a void type.
063: *
064: * @param t the type to visit
065: */
066: public void visitVoidType(VoidType t);
067:
068: /**
069: * Visits a reference type.
070: *
071: * @param t the type to visit
072: */
073: public void visitReferenceType(ReferenceType t);
074:
075: /**
076: * Visits a declared type.
077: *
078: * @param t the type to visit
079: */
080: public void visitDeclaredType(DeclaredType t);
081:
082: /**
083: * Visits a class type.
084: *
085: * @param t the type to visit
086: */
087: public void visitClassType(ClassType t);
088:
089: /**
090: * Visits an enum type.
091: *
092: * @param t the type to visit
093: */
094: public void visitEnumType(EnumType t);
095:
096: /**
097: * Visits an interface type.
098: *
099: * @param t the type to visit
100: */
101: public void visitInterfaceType(InterfaceType t);
102:
103: /**
104: * Visits an annotation type.
105: *
106: * @param t the type to visit
107: */
108: public void visitAnnotationType(AnnotationType t);
109:
110: /**
111: * Visits an array type.
112: *
113: * @param t the type to visit
114: */
115: public void visitArrayType(ArrayType t);
116:
117: /**
118: * Visits a type variable.
119: *
120: * @param t the type to visit
121: */
122: public void visitTypeVariable(TypeVariable t);
123:
124: /**
125: * Visits a wildcard.
126: *
127: * @param t the type to visit
128: */
129: public void visitWildcardType(WildcardType t);
130: }
|