author | dmarkov |
Mon, 23 Sep 2019 17:18:03 +0100 | |
changeset 58328 | fe46ee1d42ee |
parent 55382 | 30b1b7b4dd86 |
permissions | -rw-r--r-- |
6720 | 1 |
/* |
55382 | 2 |
* Copyright (c) 2010, 2019, 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 |
||
24 |
import java.util.*; |
|
25 |
import javax.annotation.processing.*; |
|
26 |
import javax.lang.model.SourceVersion; |
|
27 |
import javax.lang.model.util.*; |
|
10192
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
28 |
import static javax.lang.model.SourceVersion.*; |
6720 | 29 |
|
30 |
/** |
|
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22170
diff
changeset
|
31 |
* An abstract annotation processor tailored to {@code javac} regression testing. |
6720 | 32 |
*/ |
33 |
public abstract class JavacTestingAbstractProcessor extends AbstractProcessor { |
|
48209
5fb7750f22cd
8193191: Update JavacTestingAbstractProcessor for JDK 10
darcy
parents:
47216
diff
changeset
|
34 |
private static final Set<String> allAnnotations = Set.of("*"); |
6720 | 35 |
|
36 |
protected Elements eltUtils; |
|
37 |
protected Elements elements; |
|
38 |
protected Types typeUtils; |
|
39 |
protected Types types; |
|
40 |
protected Filer filer; |
|
41 |
protected Messager messager; |
|
42 |
protected Map<String, String> options; |
|
43 |
||
44 |
/** |
|
45 |
* Constructor for subclasses to call. |
|
46 |
*/ |
|
47 |
protected JavacTestingAbstractProcessor() { |
|
48 |
super(); |
|
49 |
} |
|
50 |
||
51 |
/** |
|
52 |
* Return the latest source version. Unless this method is |
|
53 |
* overridden, an {@code IllegalStateException} will be thrown if a |
|
54 |
* subclass has a {@code SupportedSourceVersion} annotation. |
|
55 |
*/ |
|
56 |
@Override |
|
57 |
public SourceVersion getSupportedSourceVersion() { |
|
58 |
SupportedSourceVersion ssv = this.getClass().getAnnotation(SupportedSourceVersion.class); |
|
59 |
if (ssv != null) |
|
60 |
throw new IllegalStateException("SupportedSourceVersion annotation not supported here."); |
|
61 |
||
62 |
return SourceVersion.latest(); |
|
63 |
} |
|
64 |
||
65 |
/** |
|
66 |
* If the processor class is annotated with {@link |
|
67 |
* SupportedAnnotationTypes}, return an unmodifiable set with the |
|
68 |
* same set of strings as the annotation. If the class is not so |
|
69 |
* annotated, a one-element set containing {@code "*"} is returned |
|
70 |
* to indicate all annotations are processed. |
|
71 |
* |
|
72 |
* @return the names of the annotation types supported by this |
|
73 |
* processor, or an empty set if none |
|
74 |
*/ |
|
75 |
@Override |
|
76 |
public Set<String> getSupportedAnnotationTypes() { |
|
77 |
SupportedAnnotationTypes sat = this.getClass().getAnnotation(SupportedAnnotationTypes.class); |
|
78 |
if (sat != null) |
|
79 |
return super.getSupportedAnnotationTypes(); |
|
80 |
else |
|
81 |
return allAnnotations; |
|
82 |
} |
|
83 |
||
84 |
@Override |
|
85 |
public void init(ProcessingEnvironment processingEnv) { |
|
86 |
super.init(processingEnv); |
|
87 |
elements = eltUtils = processingEnv.getElementUtils(); |
|
88 |
types = typeUtils = processingEnv.getTypeUtils(); |
|
89 |
filer = processingEnv.getFiler(); |
|
90 |
messager = processingEnv.getMessager(); |
|
91 |
options = processingEnv.getOptions(); |
|
92 |
} |
|
10192
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
93 |
|
36526 | 94 |
protected void addExports(String moduleName, String... packageNames) { |
95 |
for (String packageName : packageNames) { |
|
96 |
try { |
|
44573
245bb4e6f983
8177530: Module system implementation refresh (4/2017)
alanb
parents:
36526
diff
changeset
|
97 |
ModuleLayer layer = ModuleLayer.boot(); |
36526 | 98 |
Optional<Module> m = layer.findModule(moduleName); |
99 |
if (!m.isPresent()) |
|
100 |
throw new Error("module not found: " + moduleName); |
|
101 |
m.get().addExports(packageName, getClass().getModule()); |
|
102 |
} catch (Exception e) { |
|
103 |
throw new Error("failed to add exports for " + moduleName + "/" + packageName); |
|
104 |
} |
|
105 |
} |
|
106 |
} |
|
107 |
||
10192
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
108 |
/* |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
109 |
* 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
|
110 |
* corresponding platform visitor type. |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
111 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
112 |
|
55382 | 113 |
@SupportedSourceVersion(RELEASE_14) |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22170
diff
changeset
|
114 |
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
|
115 |
|
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 |
* Constructor for concrete subclasses to call. |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
118 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
119 |
protected AbstractAnnotationValueVisitor() { |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
120 |
super(); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
121 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
122 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
123 |
|
55382 | 124 |
@SupportedSourceVersion(RELEASE_14) |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22170
diff
changeset
|
125 |
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
|
126 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
127 |
* Constructor for concrete subclasses to call. |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
128 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
129 |
protected AbstractElementVisitor(){ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
130 |
super(); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
131 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
132 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
133 |
|
55382 | 134 |
@SupportedSourceVersion(RELEASE_14) |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22170
diff
changeset
|
135 |
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
|
136 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
137 |
* Constructor for concrete subclasses to call. |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
138 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
139 |
protected AbstractTypeVisitor() { |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
140 |
super(); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
141 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
142 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
143 |
|
55382 | 144 |
@SupportedSourceVersion(RELEASE_14) |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22170
diff
changeset
|
145 |
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
|
146 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
147 |
* Constructor for concrete subclasses; uses {@code null} for the |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
148 |
* default value. |
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 |
protected ElementKindVisitor() { |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
151 |
super(null); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
152 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
153 |
|
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 the argument 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 |
* @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
|
159 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
160 |
protected ElementKindVisitor(R defaultValue) { |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
161 |
super(defaultValue); |
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 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
164 |
|
55382 | 165 |
@SupportedSourceVersion(RELEASE_14) |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22170
diff
changeset
|
166 |
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
|
167 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
168 |
* Constructor for concrete subclasses; uses {@code null} for the |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
169 |
* default value. |
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 |
protected ElementScanner(){ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
172 |
super(null); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
173 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
174 |
|
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 the argument 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(R defaultValue){ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
180 |
super(defaultValue); |
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 |
|
55382 | 184 |
@SupportedSourceVersion(RELEASE_14) |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22170
diff
changeset
|
185 |
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
|
186 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
187 |
* Constructor for concrete subclasses; uses {@code null} for the |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
188 |
* default value. |
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 |
protected SimpleAnnotationValueVisitor() { |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
191 |
super(null); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
192 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
193 |
|
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 the argument 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 |
* @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
|
199 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
200 |
protected SimpleAnnotationValueVisitor(R defaultValue) { |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
201 |
super(defaultValue); |
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 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
204 |
|
55382 | 205 |
@SupportedSourceVersion(RELEASE_14) |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22170
diff
changeset
|
206 |
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
|
207 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
208 |
* Constructor for concrete subclasses; uses {@code null} for the |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
209 |
* default value. |
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 |
protected SimpleElementVisitor(){ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
212 |
super(null); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
213 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
214 |
|
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 the argument 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 |
* @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
|
220 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
221 |
protected SimpleElementVisitor(R defaultValue){ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
222 |
super(defaultValue); |
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 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
225 |
|
55382 | 226 |
@SupportedSourceVersion(RELEASE_14) |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22170
diff
changeset
|
227 |
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
|
228 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
229 |
* Constructor for concrete subclasses; uses {@code null} for the |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
230 |
* default value. |
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 |
protected SimpleTypeVisitor(){ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
233 |
super(null); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
234 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
235 |
|
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 the argument 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 |
* @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
|
241 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
242 |
protected SimpleTypeVisitor(R defaultValue){ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
243 |
super(defaultValue); |
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 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
246 |
|
55382 | 247 |
@SupportedSourceVersion(RELEASE_14) |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22170
diff
changeset
|
248 |
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
|
249 |
/** |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
250 |
* Constructor for concrete subclasses to call; uses {@code null} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
251 |
* for the default value. |
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 |
protected TypeKindVisitor() { |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
254 |
super(null); |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
255 |
} |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
256 |
|
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 the argument |
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 |
* @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
|
262 |
*/ |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
263 |
protected TypeKindVisitor(R defaultValue) { |
378321489bea
7025809: Provided new utility visitors supporting SourceVersion.RELEASE_8
darcy
parents:
8846
diff
changeset
|
264 |
super(defaultValue); |
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 |
} |
6720 | 267 |
} |