1 /*
   2  * Copyright (c) 2004, Oracle and/or its affiliates. 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.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.mirror.util;
  27 
  28 
  29 import com.sun.mirror.type.*;
  30 
  31 
  32 /**
  33  * A simple visitor for types.
  34  *
  35  * <p> The implementations of the methods of this class do nothing but
  36  * delegate up the type hierarchy.  A subclass should override the
  37  * methods that correspond to the kinds of types on which it will
  38  * operate.
  39  *
  40  * @deprecated All components of this API have been superseded by the
  41  * standardized annotation processing API.  The replacement for the
  42  * functionality of this class is {@link
  43  * javax.lang.model.util.SimpleTypeVisitor6}.
  44  *
  45  * @author Joseph D. Darcy
  46  * @author Scott Seligman
  47  * @since 1.5
  48  */
  49 @Deprecated
  50 @SuppressWarnings("deprecation")
  51 public class SimpleTypeVisitor implements TypeVisitor {
  52 
  53     /**
  54      * Creates a new <tt>SimpleTypeVisitor</tt>.
  55      */
  56     public SimpleTypeVisitor() {}
  57 
  58     /**
  59      * Visits a type mirror.
  60      * The implementation does nothing.
  61      * @param t the type to visit
  62      */
  63     public void visitTypeMirror(TypeMirror t) {
  64     }
  65 
  66     /**
  67      * Visits a primitive type.
  68      * The implementation simply invokes
  69      * {@link #visitTypeMirror visitTypeMirror}.
  70      * @param t the type to visit
  71      */
  72     public void visitPrimitiveType(PrimitiveType t) {
  73         visitTypeMirror(t);
  74     }
  75 
  76     /**
  77      * Visits a void type.
  78      * The implementation simply invokes
  79      * {@link #visitTypeMirror visitTypeMirror}.
  80      * @param t the type to visit
  81      */
  82     public void visitVoidType(VoidType t) {
  83         visitTypeMirror(t);
  84     }
  85 
  86     /**
  87      * Visits a reference type.
  88      * The implementation simply invokes
  89      * {@link #visitTypeMirror visitTypeMirror}.
  90      * @param t the type to visit
  91      */
  92     public void visitReferenceType(ReferenceType t) {
  93         visitTypeMirror(t);
  94     }
  95 
  96     /**
  97      * Visits a declared type.
  98      * The implementation simply invokes
  99      * {@link #visitReferenceType visitReferenceType}.
 100      * @param t the type to visit
 101      */
 102     public void visitDeclaredType(DeclaredType t) {
 103         visitReferenceType(t);
 104     }
 105 
 106     /**
 107      * Visits a class type.
 108      * The implementation simply invokes
 109      * {@link #visitDeclaredType visitDeclaredType}.
 110      * @param t the type to visit
 111      */
 112     public void visitClassType(ClassType t) {
 113         visitDeclaredType(t);
 114     }
 115 
 116     /**
 117      * Visits an enum type.
 118      * The implementation simply invokes
 119      * {@link #visitClassType visitClassType}.
 120      * @param t the type to visit
 121      */
 122     public void visitEnumType(EnumType t) {
 123         visitClassType(t);
 124     }
 125 
 126     /**
 127      * Visits an interface type.
 128      * The implementation simply invokes
 129      * {@link #visitDeclaredType visitDeclaredType}.
 130      * @param t the type to visit
 131      */
 132     public void visitInterfaceType(InterfaceType t) {
 133         visitDeclaredType(t);
 134     }
 135 
 136     /**
 137      * Visits an annotation type.
 138      * The implementation simply invokes
 139      * {@link #visitInterfaceType visitInterfaceType}.
 140      * @param t the type to visit
 141      */
 142     public void visitAnnotationType(AnnotationType t) {
 143         visitInterfaceType(t);
 144     }
 145 
 146     /**
 147      * Visits an array type.
 148      * The implementation simply invokes
 149      * {@link #visitReferenceType visitReferenceType}.
 150      * @param t the type to visit
 151      */
 152     public void visitArrayType(ArrayType t) {
 153         visitReferenceType(t);
 154     }
 155 
 156     /**
 157      * Visits a type variable.
 158      * The implementation simply invokes
 159      * {@link #visitReferenceType visitReferenceType}.
 160      * @param t the type to visit
 161      */
 162     public void visitTypeVariable(TypeVariable t) {
 163         visitReferenceType(t);
 164     }
 165 
 166     /**
 167      * Visits a wildcard.
 168      * The implementation simply invokes
 169      * {@link #visitTypeMirror visitTypeMirror}.
 170      * @param t the type to visit
 171      */
 172     public void visitWildcardType(WildcardType t) {
 173         visitTypeMirror(t);
 174     }
 175 }