author | ysuenaga |
Wed, 30 Mar 2016 21:05:13 +0900 | |
changeset 37218 | c7241bc368bf |
parent 36526 | 3b41f1c69604 |
child 44573 | 245bb4e6f983 |
permissions | -rw-r--r-- |
6720 | 1 |
/* |
36526 | 2 |
* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. |
6720 | 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. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
*/ |
|
23 |
||
36526 | 24 |
import java.lang.reflect.Layer; |
25 |
import java.lang.reflect.Module; |
|
6720 | 26 |
import java.util.*; |
27 |
import javax.annotation.processing.*; |
|
28 |
import javax.lang.model.SourceVersion; |
|
29 |
import javax.lang.model.util.*; |
|
10192
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
30 |
import static javax.lang.model.SourceVersion.*; |
6720 | 31 |
|
32 |
/** |
|
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22170
diff
changeset
|
33 |
* An abstract annotation processor tailored to {@code javac} regression testing. |
6720 | 34 |
*/ |
35 |
public abstract class JavacTestingAbstractProcessor extends AbstractProcessor { |
|
36 |
private static final Set<String> allAnnotations; |
|
37 |
||
38 |
static { |
|
39 |
Set<String> tmp = new HashSet<>(); |
|
40 |
tmp.add("*"); |
|
41 |
allAnnotations = Collections.unmodifiableSet(tmp); |
|
42 |
} |
|
43 |
||
44 |
protected Elements eltUtils; |
|
45 |
protected Elements elements; |
|
46 |
protected Types typeUtils; |
|
47 |
protected Types types; |
|
48 |
protected Filer filer; |
|
49 |
protected Messager messager; |
|
50 |
protected Map<String, String> options; |
|
51 |
||
52 |
/** |
|
53 |
* Constructor for subclasses to call. |
|
54 |
*/ |
|
55 |
protected JavacTestingAbstractProcessor() { |
|
56 |
super(); |
|
57 |
} |
|
58 |
||
59 |
/** |
|
60 |
* Return the latest source version. Unless this method is |
|
61 |
* overridden, an {@code IllegalStateException} will be thrown if a |
|
62 |
* subclass has a {@code SupportedSourceVersion} annotation. |
|
63 |
*/ |
|
64 |
@Override |
|
65 |
public SourceVersion getSupportedSourceVersion() { |
|
66 |
SupportedSourceVersion ssv = this.getClass().getAnnotation(SupportedSourceVersion.class); |
|
67 |
if (ssv != null) |
|
68 |
throw new IllegalStateException("SupportedSourceVersion annotation not supported here."); |
|
69 |
||
70 |
return SourceVersion.latest(); |
|
71 |
} |
|
72 |
||
73 |
/** |
|
74 |
* If the processor class is annotated with {@link |
|
75 |
* SupportedAnnotationTypes}, return an unmodifiable set with the |
|
76 |
* same set of strings as the annotation. If the class is not so |
|
77 |
* annotated, a one-element set containing {@code "*"} is returned |
|
78 |
* to indicate all annotations are processed. |
|
79 |
* |
|
80 |
* @return the names of the annotation types supported by this |
|
81 |
* processor, or an empty set if none |
|
82 |
*/ |
|
83 |
@Override |
|
84 |
public Set<String> getSupportedAnnotationTypes() { |
|
85 |
SupportedAnnotationTypes sat = this.getClass().getAnnotation(SupportedAnnotationTypes.class); |
|
86 |
if (sat != null) |
|
87 |
return super.getSupportedAnnotationTypes(); |
|
88 |
else |
|
89 |
return allAnnotations; |
|
90 |
} |
|
91 |
||
92 |
@Override |
|
93 |
public void init(ProcessingEnvironment processingEnv) { |
|
94 |
super.init(processingEnv); |
|
95 |
elements = eltUtils = processingEnv.getElementUtils(); |
|
96 |
types = typeUtils = processingEnv.getTypeUtils(); |
|
97 |
filer = processingEnv.getFiler(); |
|
98 |
messager = processingEnv.getMessager(); |
|
99 |
options = processingEnv.getOptions(); |
|
100 |
} |
|
10192
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
101 |
|
36526 | 102 |
protected void addExports(String moduleName, String... packageNames) { |
103 |
for (String packageName : packageNames) { |
|
104 |
try { |
|
105 |
Layer layer = Layer.boot(); |
|
106 |
Optional<Module> m = layer.findModule(moduleName); |
|
107 |
if (!m.isPresent()) |
|
108 |
throw new Error("module not found: " + moduleName); |
|
109 |
m.get().addExports(packageName, getClass().getModule()); |
|
110 |
} catch (Exception e) { |
|
111 |
throw new Error("failed to add exports for " + moduleName + "/" + packageName); |
|
112 |
} |
|
113 |
} |
|
114 |
} |
|
115 |
||
10192
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
116 |
/* |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
117 |
* The set of visitors below will directly extend the most recent |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
118 |
* corresponding platform visitor type. |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
119 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
120 |
|
22170
62da5257a0a7
8031360: Update langtools code base to use RELEASE_9
darcy
parents:
10192
diff
changeset
|
121 |
@SupportedSourceVersion(RELEASE_9) |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22170
diff
changeset
|
122 |
public static abstract class AbstractAnnotationValueVisitor<R, P> extends AbstractAnnotationValueVisitor9<R, P> { |
10192
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
123 |
|
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
124 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
125 |
* Constructor for concrete subclasses to call. |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
126 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
127 |
protected AbstractAnnotationValueVisitor() { |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
128 |
super(); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
129 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
130 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
131 |
|
22170
62da5257a0a7
8031360: Update langtools code base to use RELEASE_9
darcy
parents:
10192
diff
changeset
|
132 |
@SupportedSourceVersion(RELEASE_9) |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22170
diff
changeset
|
133 |
public static abstract class AbstractElementVisitor<R, P> extends AbstractElementVisitor9<R, P> { |
10192
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
134 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
135 |
* Constructor for concrete subclasses to call. |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
136 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
137 |
protected AbstractElementVisitor(){ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
138 |
super(); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
139 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
140 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
141 |
|
22170
62da5257a0a7
8031360: Update langtools code base to use RELEASE_9
darcy
parents:
10192
diff
changeset
|
142 |
@SupportedSourceVersion(RELEASE_9) |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22170
diff
changeset
|
143 |
public static abstract class AbstractTypeVisitor<R, P> extends AbstractTypeVisitor9<R, P> { |
10192
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
144 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
145 |
* Constructor for concrete subclasses to call. |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
146 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
147 |
protected AbstractTypeVisitor() { |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
148 |
super(); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
149 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
150 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
151 |
|
22170
62da5257a0a7
8031360: Update langtools code base to use RELEASE_9
darcy
parents:
10192
diff
changeset
|
152 |
@SupportedSourceVersion(RELEASE_9) |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22170
diff
changeset
|
153 |
public static class ElementKindVisitor<R, P> extends ElementKindVisitor9<R, P> { |
10192
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
154 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
155 |
* Constructor for concrete subclasses; uses {@code null} for the |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
156 |
* default value. |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
157 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
158 |
protected ElementKindVisitor() { |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
159 |
super(null); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
160 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
161 |
|
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
162 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
163 |
* Constructor for concrete subclasses; uses the argument for the |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
164 |
* default value. |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
165 |
* |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
166 |
* @param defaultValue the value to assign to {@link #DEFAULT_VALUE} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
167 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
168 |
protected ElementKindVisitor(R defaultValue) { |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
169 |
super(defaultValue); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
170 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
171 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
172 |
|
22170
62da5257a0a7
8031360: Update langtools code base to use RELEASE_9
darcy
parents:
10192
diff
changeset
|
173 |
@SupportedSourceVersion(RELEASE_9) |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22170
diff
changeset
|
174 |
public static class ElementScanner<R, P> extends ElementScanner9<R, P> { |
10192
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
175 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
176 |
* Constructor for concrete subclasses; uses {@code null} for the |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
177 |
* default value. |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
178 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
179 |
protected ElementScanner(){ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
180 |
super(null); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
181 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
182 |
|
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
183 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
184 |
* Constructor for concrete subclasses; uses the argument for the |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
185 |
* default value. |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
186 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
187 |
protected ElementScanner(R defaultValue){ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
188 |
super(defaultValue); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
189 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
190 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
191 |
|
22170
62da5257a0a7
8031360: Update langtools code base to use RELEASE_9
darcy
parents:
10192
diff
changeset
|
192 |
@SupportedSourceVersion(RELEASE_9) |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22170
diff
changeset
|
193 |
public static class SimpleAnnotationValueVisitor<R, P> extends SimpleAnnotationValueVisitor9<R, P> { |
10192
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
194 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
195 |
* Constructor for concrete subclasses; uses {@code null} for the |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
196 |
* default value. |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
197 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
198 |
protected SimpleAnnotationValueVisitor() { |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
199 |
super(null); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
200 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
201 |
|
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
202 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
203 |
* Constructor for concrete subclasses; uses the argument for the |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
204 |
* default value. |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
205 |
* |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
206 |
* @param defaultValue the value to assign to {@link #DEFAULT_VALUE} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
207 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
208 |
protected SimpleAnnotationValueVisitor(R defaultValue) { |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
209 |
super(defaultValue); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
210 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
211 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
212 |
|
22170
62da5257a0a7
8031360: Update langtools code base to use RELEASE_9
darcy
parents:
10192
diff
changeset
|
213 |
@SupportedSourceVersion(RELEASE_9) |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22170
diff
changeset
|
214 |
public static class SimpleElementVisitor<R, P> extends SimpleElementVisitor9<R, P> { |
10192
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
215 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
216 |
* Constructor for concrete subclasses; uses {@code null} for the |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
217 |
* default value. |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
218 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
219 |
protected SimpleElementVisitor(){ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
220 |
super(null); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
221 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
222 |
|
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
223 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
224 |
* Constructor for concrete subclasses; uses the argument for the |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
225 |
* default value. |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
226 |
* |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
227 |
* @param defaultValue the value to assign to {@link #DEFAULT_VALUE} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
228 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
229 |
protected SimpleElementVisitor(R defaultValue){ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
230 |
super(defaultValue); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
231 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
232 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
233 |
|
22170
62da5257a0a7
8031360: Update langtools code base to use RELEASE_9
darcy
parents:
10192
diff
changeset
|
234 |
@SupportedSourceVersion(RELEASE_9) |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22170
diff
changeset
|
235 |
public static class SimpleTypeVisitor<R, P> extends SimpleTypeVisitor9<R, P> { |
10192
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
236 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
237 |
* Constructor for concrete subclasses; uses {@code null} for the |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
238 |
* default value. |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
239 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
240 |
protected SimpleTypeVisitor(){ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
241 |
super(null); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
242 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
243 |
|
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
244 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
245 |
* Constructor for concrete subclasses; uses the argument for the |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
246 |
* default value. |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
247 |
* |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
248 |
* @param defaultValue the value to assign to {@link #DEFAULT_VALUE} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
249 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
250 |
protected SimpleTypeVisitor(R defaultValue){ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
251 |
super(defaultValue); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
252 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
253 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
254 |
|
22170
62da5257a0a7
8031360: Update langtools code base to use RELEASE_9
darcy
parents:
10192
diff
changeset
|
255 |
@SupportedSourceVersion(RELEASE_9) |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22170
diff
changeset
|
256 |
public static class TypeKindVisitor<R, P> extends TypeKindVisitor9<R, P> { |
10192
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
257 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
258 |
* Constructor for concrete subclasses to call; uses {@code null} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
259 |
* for the default value. |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
260 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
261 |
protected TypeKindVisitor() { |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
262 |
super(null); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
263 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
264 |
|
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
265 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
266 |
* Constructor for concrete subclasses to call; uses the argument |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
267 |
* for the default value. |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
268 |
* |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
269 |
* @param defaultValue the value to assign to {@link #DEFAULT_VALUE} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
270 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
271 |
protected TypeKindVisitor(R defaultValue) { |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
272 |
super(defaultValue); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
273 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
274 |
} |
6720 | 275 |
} |