KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)SimpleTypeVisitor.java 1.4 04/06/07
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
11 import com.sun.mirror.type.*;
12
13
14 /**
15  * A simple visitor for types.
16  *
17  * <p> The implementations of the methods of this class do nothing but
18  * delegate up the type hierarchy. A subclass should override the
19  * methods that correspond to the kinds of types on which it will
20  * operate.
21  *
22  * @author Joseph D. Darcy
23  * @author Scott Seligman
24  * @version 1.4 04/06/07
25  * @since 1.5
26  */

27
28 public class SimpleTypeVisitor implements TypeVisitor {
29
30     /**
31      * Creates a new <tt>SimpleTypeVisitor</tt>.
32      */

33     public SimpleTypeVisitor() {}
34
35     /**
36      * Visits a type mirror.
37      * The implementation does nothing.
38      * @param t the type to visit
39      */

40     public void visitTypeMirror(TypeMirror t) {
41     }
42
43     /**
44      * Visits a primitive type.
45      * The implementation simply invokes
46      * {@link #visitTypeMirror visitTypeMirror}.
47      * @param t the type to visit
48      */

49     public void visitPrimitiveType(PrimitiveType t) {
50     visitTypeMirror(t);
51     }
52
53     /**
54      * Visits a void type.
55      * The implementation simply invokes
56      * {@link #visitTypeMirror visitTypeMirror}.
57      * @param t the type to visit
58      */

59     public void visitVoidType(VoidType t) {
60     visitTypeMirror(t);
61     }
62
63     /**
64      * Visits a reference type.
65      * The implementation simply invokes
66      * {@link #visitTypeMirror visitTypeMirror}.
67      * @param t the type to visit
68      */

69     public void visitReferenceType(ReferenceType t) {
70     visitTypeMirror(t);
71     }
72
73     /**
74      * Visits a declared type.
75      * The implementation simply invokes
76      * {@link #visitReferenceType visitReferenceType}.
77      * @param t the type to visit
78      */

79     public void visitDeclaredType(DeclaredType t) {
80     visitReferenceType(t);
81     }
82
83     /**
84      * Visits a class type.
85      * The implementation simply invokes
86      * {@link #visitDeclaredType visitDeclaredType}.
87      * @param t the type to visit
88      */

89     public void visitClassType(ClassType t) {
90     visitDeclaredType(t);
91     }
92
93     /**
94      * Visits an enum type.
95      * The implementation simply invokes
96      * {@link #visitClassType visitClassType}.
97      * @param t the type to visit
98      */

99     public void visitEnumType(EnumType t) {
100     visitClassType(t);
101     }
102
103     /**
104      * Visits an interface type.
105      * The implementation simply invokes
106      * {@link #visitDeclaredType visitDeclaredType}.
107      * @param t the type to visit
108      */

109     public void visitInterfaceType(InterfaceType t) {
110     visitDeclaredType(t);
111     }
112
113     /**
114      * Visits an annotation type.
115      * The implementation simply invokes
116      * {@link #visitInterfaceType visitInterfaceType}.
117      * @param t the type to visit
118      */

119     public void visitAnnotationType(AnnotationType t) {
120     visitInterfaceType(t);
121     }
122
123     /**
124      * Visits an array type.
125      * The implementation simply invokes
126      * {@link #visitReferenceType visitReferenceType}.
127      * @param t the type to visit
128      */

129     public void visitArrayType(ArrayType t) {
130     visitReferenceType(t);
131     }
132
133     /**
134      * Visits a type variable.
135      * The implementation simply invokes
136      * {@link #visitReferenceType visitReferenceType}.
137      * @param t the type to visit
138      */

139     public void visitTypeVariable(TypeVariable t) {
140     visitReferenceType(t);
141     }
142
143     /**
144      * Visits a wildcard.
145      * The implementation simply invokes
146      * {@link #visitTypeMirror visitTypeMirror}.
147      * @param t the type to visit
148      */

149     public void visitWildcardType(WildcardType t) {
150     visitTypeMirror(t);
151     }
152 }
153
Popular Tags