diamond type visitor
[idea/community.git] / java / java-psi-api / src / com / intellij / psi / PsiTypeVisitor.java
1 /*
2  * Copyright 2000-2009 JetBrains s.r.o.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.intellij.psi;
17
18 /**
19  * Visitor which can be used to visit Java types.
20  * 
21  * @author dsl
22  */
23 public class PsiTypeVisitor<A> {
24   public A visitType(PsiType type) {
25     return null;
26   }
27
28   public A visitPrimitiveType(PsiPrimitiveType primitiveType) {
29     return visitType(primitiveType);
30   }
31
32   public A visitArrayType(PsiArrayType arrayType) {
33     return visitType(arrayType);
34   }
35
36   public A visitClassType(PsiClassType classType) {
37     return visitType(classType);
38   }
39
40   public A visitCapturedWildcardType(PsiCapturedWildcardType capturedWildcardType) {
41     return visitWildcardType(capturedWildcardType.getWildcard());
42   }
43
44   public A visitWildcardType(PsiWildcardType wildcardType) {
45     return visitType(wildcardType);
46   }
47
48   public A visitEllipsisType(PsiEllipsisType ellipsisType) {
49     return visitArrayType(ellipsisType);
50   }
51
52   public A visitDisjunctionType(PsiDisjunctionType disjunctionType) {
53     return visitType(disjunctionType);
54   }
55   
56   public A visitDiamondType(PsiDiamondType diamondType) {
57     return visitType(diamondType);
58   }
59 }