1 /*
   2  * Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Sun designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Sun in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  22  * CA 95054 USA or visit www.sun.com if you need additional information or
  23  * have any questions.
  24  */
  25 
  26 package com.sun.mirror.util;
  27 
  28 
  29 import com.sun.mirror.type.*;
  30 
  31 
  32 /**
  33  * A visitor for types, in the style of the standard visitor design pattern.
  34  * This is used to operate on a type when the kind
  35  * of type is unknown at compile time.
  36  * When a visitor is passed to a type's
  37  * {@link TypeMirror#accept accept} method,
  38  * the most specific <tt>visit<i>Xxx</i></tt> method applicable to
  39  * that type is invoked.
  40  *
  41  * @author Joseph D. Darcy
  42  * @author Scott Seligman
  43  * @since 1.5
  44  */
  45 
  46 public interface TypeVisitor {
  47 
  48     /**
  49      * Visits a type mirror.
  50      *
  51      * @param t the type to visit
  52      */
  53     public void visitTypeMirror(TypeMirror t);
  54 
  55     /**
  56      * Visits a primitive type.
  57 
  58      * @param t the type to visit
  59      */
  60     public void visitPrimitiveType(PrimitiveType t);
  61 
  62     /**
  63      * Visits a void type.
  64      *
  65      * @param t the type to visit
  66      */
  67     public void visitVoidType(VoidType t);
  68 
  69     /**
  70      * Visits a reference type.
  71      *
  72      * @param t the type to visit
  73      */
  74     public void visitReferenceType(ReferenceType t);
  75 
  76     /**
  77      * Visits a declared type.
  78      *
  79      * @param t the type to visit
  80      */
  81     public void visitDeclaredType(DeclaredType t);
  82 
  83     /**
  84      * Visits a class type.
  85      *
  86      * @param t the type to visit
  87      */
  88     public void visitClassType(ClassType t);
  89 
  90     /**
  91      * Visits an enum type.
  92      *
  93      * @param t the type to visit
  94      */
  95     public void visitEnumType(EnumType t);
  96 
  97     /**
  98      * Visits an interface type.
  99      *
 100      * @param t the type to visit
 101      */
 102     public void visitInterfaceType(InterfaceType t);
 103 
 104     /**
 105      * Visits an annotation type.
 106      *
 107      * @param t the type to visit
 108      */
 109     public void visitAnnotationType(AnnotationType t);
 110 
 111     /**
 112      * Visits an array type.
 113      *
 114      * @param t the type to visit
 115      */
 116     public void visitArrayType(ArrayType t);
 117 
 118     /**
 119      * Visits a type variable.
 120      *
 121      * @param t the type to visit
 122      */
 123     public void visitTypeVariable(TypeVariable t);
 124 
 125     /**
 126      * Visits a wildcard.
 127      *
 128      * @param t the type to visit
 129      */
 130     public void visitWildcardType(WildcardType t);
 131 }