KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)TypeVisitor.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 visitor for types, in the style of the standard visitor design pattern.
16  * This is used to operate on a type when the kind
17  * of type is unknown at compile time.
18  * When a visitor is passed to a type's
19  * {@link TypeMirror#accept accept} method,
20  * the most specific <tt>visit<i>Xxx</i></tt> method applicable to
21  * that type is invoked.
22  *
23  * @author Joseph D. Darcy
24  * @author Scott Seligman
25  * @version 1.4 04/06/07
26  * @since 1.5
27  */

28
29 public interface TypeVisitor {
30
31     /**
32      * Visits a type mirror.
33      *
34      * @param t the type to visit
35      */

36     public void visitTypeMirror(TypeMirror t);
37
38     /**
39      * Visits a primitive type.
40
41      * @param t the type to visit
42      */

43     public void visitPrimitiveType(PrimitiveType t);
44
45     /**
46      * Visits a void type.
47      *
48      * @param t the type to visit
49      */

50     public void visitVoidType(VoidType t);
51
52     /**
53      * Visits a reference type.
54      *
55      * @param t the type to visit
56      */

57     public void visitReferenceType(ReferenceType t);
58
59     /**
60      * Visits a declared type.
61      *
62      * @param t the type to visit
63      */

64     public void visitDeclaredType(DeclaredType t);
65
66     /**
67      * Visits a class type.
68      *
69      * @param t the type to visit
70      */

71     public void visitClassType(ClassType t);
72
73     /**
74      * Visits an enum type.
75      *
76      * @param t the type to visit
77      */

78     public void visitEnumType(EnumType t);
79
80     /**
81      * Visits an interface type.
82      *
83      * @param t the type to visit
84      */

85     public void visitInterfaceType(InterfaceType t);
86
87     /**
88      * Visits an annotation type.
89      *
90      * @param t the type to visit
91      */

92     public void visitAnnotationType(AnnotationType t);
93
94     /**
95      * Visits an array type.
96      *
97      * @param t the type to visit
98      */

99     public void visitArrayType(ArrayType t);
100
101     /**
102      * Visits a type variable.
103      *
104      * @param t the type to visit
105      */

106     public void visitTypeVariable(TypeVariable t);
107
108     /**
109      * Visits a wildcard.
110      *
111      * @param t the type to visit
112      */

113     public void visitWildcardType(WildcardType t);
114 }
115
Popular Tags