author | jlahoda |
Wed, 02 Oct 2019 10:59:40 +0200 | |
branch | JDK-8226585-branch |
changeset 58440 | 4c8a6d1d066c |
parent 58109 | ee07de0d2c16 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
55306 | 2 |
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. |
10 | 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 |
|
5520 | 7 |
* published by the Free Software Foundation. Oracle designates this |
10 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5520 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
10 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5520 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
10 | 24 |
*/ |
25 |
||
26 |
package com.sun.source.util; |
|
27 |
||
28 |
import com.sun.source.tree.*; |
|
29 |
||
30 |
/** |
|
31 |
* A simple visitor for tree nodes. |
|
32 |
* |
|
25287 | 33 |
* @param <R> the return type of this visitor's methods. Use {@link |
34 |
* Void} for visitors that do not need to return results. |
|
35 |
* @param <P> the type of the additional parameter to this visitor's |
|
36 |
* methods. Use {@code Void} for visitors that do not need an |
|
37 |
* additional parameter. |
|
38 |
* |
|
10 | 39 |
* @author Peter von der Ahé |
40 |
* @since 1.6 |
|
41 |
*/ |
|
42 |
public class SimpleTreeVisitor <R,P> implements TreeVisitor<R,P> { |
|
25287 | 43 |
/** |
44 |
* The default value, returned by the {@link #defaultAction default action}. |
|
45 |
*/ |
|
10 | 46 |
protected final R DEFAULT_VALUE; |
47 |
||
25287 | 48 |
/** |
49 |
* Creates a visitor, with a DEFAULT_VALUE of {@code null}. |
|
50 |
*/ |
|
10 | 51 |
protected SimpleTreeVisitor() { |
52 |
DEFAULT_VALUE = null; |
|
53 |
} |
|
54 |
||
25287 | 55 |
/** |
56 |
* Creates a visitor, with a specified DEFAULT_VALUE. |
|
57 |
* @param defaultValue the default value to be returned by the default action. |
|
58 |
*/ |
|
10 | 59 |
protected SimpleTreeVisitor(R defaultValue) { |
60 |
DEFAULT_VALUE = defaultValue; |
|
61 |
} |
|
62 |
||
25287 | 63 |
/** |
64 |
* The default action, used by all visit methods that are not overridden. |
|
65 |
* @param node the node being visited |
|
66 |
* @param p the parameter value passed to the visit method |
|
67 |
* @return the result value to be returned from the visit method |
|
68 |
*/ |
|
10 | 69 |
protected R defaultAction(Tree node, P p) { |
70 |
return DEFAULT_VALUE; |
|
71 |
} |
|
72 |
||
25287 | 73 |
/** |
74 |
* Invokes the appropriate visit method specific to the type of the node. |
|
75 |
* @param node the node on which to dispatch |
|
76 |
* @param p a parameter to be passed to the appropriate visit method |
|
77 |
* @return the value returns from the appropriate visit method |
|
78 |
*/ |
|
10 | 79 |
public final R visit(Tree node, P p) { |
80 |
return (node == null) ? null : node.accept(this, p); |
|
81 |
} |
|
82 |
||
25287 | 83 |
/** |
84 |
* Invokes the appropriate visit method on each of a sequence of nodes. |
|
85 |
* @param nodes the nodes on which to dispatch |
|
86 |
* @param p a parameter value to be passed to each appropriate visit method |
|
87 |
* @return the value return from the last of the visit methods, or null |
|
88 |
* if none were called. |
|
89 |
*/ |
|
10 | 90 |
public final R visit(Iterable<? extends Tree> nodes, P p) { |
91 |
R r = null; |
|
92 |
if (nodes != null) |
|
93 |
for (Tree node : nodes) |
|
94 |
r = visit(node, p); |
|
95 |
return r; |
|
96 |
} |
|
97 |
||
25287 | 98 |
/** |
99 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
100 |
* |
|
101 |
* @param node {@inheritDoc} |
|
102 |
* @param p {@inheritDoc} |
|
103 |
* @return the result of {@code defaultAction} |
|
104 |
*/ |
|
105 |
@Override |
|
10 | 106 |
public R visitCompilationUnit(CompilationUnitTree node, P p) { |
107 |
return defaultAction(node, p); |
|
108 |
} |
|
109 |
||
25287 | 110 |
/** |
111 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
112 |
* |
|
113 |
* @param node {@inheritDoc} |
|
114 |
* @param p {@inheritDoc} |
|
115 |
* @return the result of {@code defaultAction} |
|
116 |
*/ |
|
117 |
@Override |
|
24069 | 118 |
public R visitPackage(PackageTree node, P p) { |
119 |
return defaultAction(node, p); |
|
120 |
} |
|
121 |
||
25287 | 122 |
/** |
123 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
124 |
* |
|
125 |
* @param node {@inheritDoc} |
|
126 |
* @param p {@inheritDoc} |
|
127 |
* @return the result of {@code defaultAction} |
|
128 |
*/ |
|
129 |
@Override |
|
10 | 130 |
public R visitImport(ImportTree node, P p) { |
131 |
return defaultAction(node, p); |
|
132 |
} |
|
133 |
||
25287 | 134 |
/** |
135 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
136 |
* |
|
137 |
* @param node {@inheritDoc} |
|
138 |
* @param p {@inheritDoc} |
|
139 |
* @return the result of {@code defaultAction} |
|
140 |
*/ |
|
141 |
@Override |
|
10 | 142 |
public R visitClass(ClassTree node, P p) { |
143 |
return defaultAction(node, p); |
|
144 |
} |
|
145 |
||
25287 | 146 |
/** |
147 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
148 |
* |
|
149 |
* @param node {@inheritDoc} |
|
150 |
* @param p {@inheritDoc} |
|
151 |
* @return the result of {@code defaultAction} |
|
152 |
*/ |
|
153 |
@Override |
|
10 | 154 |
public R visitMethod(MethodTree node, P p) { |
155 |
return defaultAction(node, p); |
|
156 |
} |
|
157 |
||
25287 | 158 |
/** |
159 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
160 |
* |
|
161 |
* @param node {@inheritDoc} |
|
162 |
* @param p {@inheritDoc} |
|
163 |
* @return the result of {@code defaultAction} |
|
164 |
*/ |
|
165 |
@Override |
|
10 | 166 |
public R visitVariable(VariableTree node, P p) { |
167 |
return defaultAction(node, p); |
|
168 |
} |
|
169 |
||
25287 | 170 |
/** |
171 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
172 |
* |
|
173 |
* @param node {@inheritDoc} |
|
174 |
* @param p {@inheritDoc} |
|
175 |
* @return the result of {@code defaultAction} |
|
176 |
*/ |
|
177 |
@Override |
|
10 | 178 |
public R visitEmptyStatement(EmptyStatementTree node, P p) { |
179 |
return defaultAction(node, p); |
|
180 |
} |
|
181 |
||
25287 | 182 |
/** |
183 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
184 |
* |
|
185 |
* @param node {@inheritDoc} |
|
186 |
* @param p {@inheritDoc} |
|
187 |
* @return the result of {@code defaultAction} |
|
188 |
*/ |
|
189 |
@Override |
|
10 | 190 |
public R visitBlock(BlockTree node, P p) { |
191 |
return defaultAction(node, p); |
|
192 |
} |
|
193 |
||
25287 | 194 |
/** |
195 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
196 |
* |
|
197 |
* @param node {@inheritDoc} |
|
198 |
* @param p {@inheritDoc} |
|
199 |
* @return the result of {@code defaultAction} |
|
200 |
*/ |
|
201 |
@Override |
|
10 | 202 |
public R visitDoWhileLoop(DoWhileLoopTree node, P p) { |
203 |
return defaultAction(node, p); |
|
204 |
} |
|
205 |
||
25287 | 206 |
/** |
207 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
208 |
* |
|
209 |
* @param node {@inheritDoc} |
|
210 |
* @param p {@inheritDoc} |
|
211 |
* @return the result of {@code defaultAction} |
|
212 |
*/ |
|
213 |
@Override |
|
10 | 214 |
public R visitWhileLoop(WhileLoopTree node, P p) { |
215 |
return defaultAction(node, p); |
|
216 |
} |
|
217 |
||
25287 | 218 |
/** |
219 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
220 |
* |
|
221 |
* @param node {@inheritDoc} |
|
222 |
* @param p {@inheritDoc} |
|
223 |
* @return the result of {@code defaultAction} |
|
224 |
*/ |
|
225 |
@Override |
|
10 | 226 |
public R visitForLoop(ForLoopTree node, P p) { |
227 |
return defaultAction(node, p); |
|
228 |
} |
|
229 |
||
25287 | 230 |
/** |
231 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
232 |
* |
|
233 |
* @param node {@inheritDoc} |
|
234 |
* @param p {@inheritDoc} |
|
235 |
* @return the result of {@code defaultAction} |
|
236 |
*/ |
|
237 |
@Override |
|
10 | 238 |
public R visitEnhancedForLoop(EnhancedForLoopTree node, P p) { |
239 |
return defaultAction(node, p); |
|
240 |
} |
|
241 |
||
25287 | 242 |
/** |
243 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
244 |
* |
|
245 |
* @param node {@inheritDoc} |
|
246 |
* @param p {@inheritDoc} |
|
247 |
* @return the result of {@code defaultAction} |
|
248 |
*/ |
|
249 |
@Override |
|
10 | 250 |
public R visitLabeledStatement(LabeledStatementTree node, P p) { |
251 |
return defaultAction(node, p); |
|
252 |
} |
|
253 |
||
25287 | 254 |
/** |
255 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
256 |
* |
|
257 |
* @param node {@inheritDoc} |
|
258 |
* @param p {@inheritDoc} |
|
259 |
* @return the result of {@code defaultAction} |
|
260 |
*/ |
|
261 |
@Override |
|
10 | 262 |
public R visitSwitch(SwitchTree node, P p) { |
263 |
return defaultAction(node, p); |
|
264 |
} |
|
265 |
||
25287 | 266 |
/** |
58440
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
267 |
* {@preview Associated with switch expressions, a preview feature of |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
268 |
* the Java language. |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
269 |
* |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
270 |
* This method is associated with <i>switch expressions</i>, a preview |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
271 |
* feature of the Java language. Preview features |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
272 |
* may be removed in a future release, or upgraded to permanent |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
273 |
* features of the Java language.} |
4c8a6d1d066c
Improving appearance of javadoc of the APIs associated with preview features.
jlahoda
parents:
58109
diff
changeset
|
274 |
* |
25287 | 275 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
276 |
* |
|
277 |
* @param node {@inheritDoc} |
|
278 |
* @param p {@inheritDoc} |
|
279 |
* @return the result of {@code defaultAction} |
|
51563
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
280 |
*/ |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
281 |
@Override |
58109
ee07de0d2c16
Updating javac behavior w.r.t. preview API. Based on darcy's patch.
jlahoda
parents:
55306
diff
changeset
|
282 |
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS) |
ee07de0d2c16
Updating javac behavior w.r.t. preview API. Based on darcy's patch.
jlahoda
parents:
55306
diff
changeset
|
283 |
@SuppressWarnings("preview") |
51563
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
284 |
public R visitSwitchExpression(SwitchExpressionTree node, P p) { |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
285 |
return defaultAction(node, p); |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
286 |
} |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
287 |
|
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
288 |
/** |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
289 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
290 |
* |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
291 |
* @param node {@inheritDoc} |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
292 |
* @param p {@inheritDoc} |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
293 |
* @return the result of {@code defaultAction} |
25287 | 294 |
*/ |
295 |
@Override |
|
10 | 296 |
public R visitCase(CaseTree node, P p) { |
297 |
return defaultAction(node, p); |
|
298 |
} |
|
299 |
||
25287 | 300 |
/** |
301 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
302 |
* |
|
303 |
* @param node {@inheritDoc} |
|
304 |
* @param p {@inheritDoc} |
|
305 |
* @return the result of {@code defaultAction} |
|
306 |
*/ |
|
307 |
@Override |
|
10 | 308 |
public R visitSynchronized(SynchronizedTree node, P p) { |
309 |
return defaultAction(node, p); |
|
310 |
} |
|
311 |
||
25287 | 312 |
/** |
313 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
314 |
* |
|
315 |
* @param node {@inheritDoc} |
|
316 |
* @param p {@inheritDoc} |
|
317 |
* @return the result of {@code defaultAction} |
|
318 |
*/ |
|
319 |
@Override |
|
10 | 320 |
public R visitTry(TryTree node, P p) { |
321 |
return defaultAction(node, p); |
|
322 |
} |
|
323 |
||
25287 | 324 |
/** |
325 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
326 |
* |
|
327 |
* @param node {@inheritDoc} |
|
328 |
* @param p {@inheritDoc} |
|
329 |
* @return the result of {@code defaultAction} |
|
330 |
*/ |
|
331 |
@Override |
|
10 | 332 |
public R visitCatch(CatchTree node, P p) { |
333 |
return defaultAction(node, p); |
|
334 |
} |
|
335 |
||
25287 | 336 |
/** |
337 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
338 |
* |
|
339 |
* @param node {@inheritDoc} |
|
340 |
* @param p {@inheritDoc} |
|
341 |
* @return the result of {@code defaultAction} |
|
342 |
*/ |
|
343 |
@Override |
|
10 | 344 |
public R visitConditionalExpression(ConditionalExpressionTree node, P p) { |
345 |
return defaultAction(node, p); |
|
346 |
} |
|
347 |
||
25287 | 348 |
/** |
349 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
350 |
* |
|
351 |
* @param node {@inheritDoc} |
|
352 |
* @param p {@inheritDoc} |
|
353 |
* @return the result of {@code defaultAction} |
|
354 |
*/ |
|
355 |
@Override |
|
10 | 356 |
public R visitIf(IfTree node, P p) { |
357 |
return defaultAction(node, p); |
|
358 |
} |
|
359 |
||
25287 | 360 |
/** |
361 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
362 |
* |
|
363 |
* @param node {@inheritDoc} |
|
364 |
* @param p {@inheritDoc} |
|
365 |
* @return the result of {@code defaultAction} |
|
366 |
*/ |
|
367 |
@Override |
|
10 | 368 |
public R visitExpressionStatement(ExpressionStatementTree node, P p) { |
369 |
return defaultAction(node, p); |
|
370 |
} |
|
371 |
||
25287 | 372 |
/** |
373 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
374 |
* |
|
375 |
* @param node {@inheritDoc} |
|
376 |
* @param p {@inheritDoc} |
|
377 |
* @return the result of {@code defaultAction} |
|
378 |
*/ |
|
379 |
@Override |
|
10 | 380 |
public R visitBreak(BreakTree node, P p) { |
381 |
return defaultAction(node, p); |
|
382 |
} |
|
383 |
||
25287 | 384 |
/** |
385 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
386 |
* |
|
387 |
* @param node {@inheritDoc} |
|
388 |
* @param p {@inheritDoc} |
|
389 |
* @return the result of {@code defaultAction} |
|
390 |
*/ |
|
391 |
@Override |
|
10 | 392 |
public R visitContinue(ContinueTree node, P p) { |
393 |
return defaultAction(node, p); |
|
394 |
} |
|
395 |
||
25287 | 396 |
/** |
397 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
398 |
* |
|
399 |
* @param node {@inheritDoc} |
|
400 |
* @param p {@inheritDoc} |
|
401 |
* @return the result of {@code defaultAction} |
|
402 |
*/ |
|
403 |
@Override |
|
10 | 404 |
public R visitReturn(ReturnTree node, P p) { |
405 |
return defaultAction(node, p); |
|
406 |
} |
|
407 |
||
25287 | 408 |
/** |
409 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
410 |
* |
|
411 |
* @param node {@inheritDoc} |
|
412 |
* @param p {@inheritDoc} |
|
413 |
* @return the result of {@code defaultAction} |
|
414 |
*/ |
|
415 |
@Override |
|
10 | 416 |
public R visitThrow(ThrowTree node, P p) { |
417 |
return defaultAction(node, p); |
|
418 |
} |
|
419 |
||
25287 | 420 |
/** |
421 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
422 |
* |
|
423 |
* @param node {@inheritDoc} |
|
424 |
* @param p {@inheritDoc} |
|
425 |
* @return the result of {@code defaultAction} |
|
426 |
*/ |
|
427 |
@Override |
|
10 | 428 |
public R visitAssert(AssertTree node, P p) { |
429 |
return defaultAction(node, p); |
|
430 |
} |
|
431 |
||
25287 | 432 |
/** |
433 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
434 |
* |
|
435 |
* @param node {@inheritDoc} |
|
436 |
* @param p {@inheritDoc} |
|
437 |
* @return the result of {@code defaultAction} |
|
438 |
*/ |
|
439 |
@Override |
|
10 | 440 |
public R visitMethodInvocation(MethodInvocationTree node, P p) { |
441 |
return defaultAction(node, p); |
|
442 |
} |
|
443 |
||
25287 | 444 |
/** |
445 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
446 |
* |
|
447 |
* @param node {@inheritDoc} |
|
448 |
* @param p {@inheritDoc} |
|
449 |
* @return the result of {@code defaultAction} |
|
450 |
*/ |
|
451 |
@Override |
|
10 | 452 |
public R visitNewClass(NewClassTree node, P p) { |
453 |
return defaultAction(node, p); |
|
454 |
} |
|
455 |
||
25287 | 456 |
/** |
457 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
458 |
* |
|
459 |
* @param node {@inheritDoc} |
|
460 |
* @param p {@inheritDoc} |
|
461 |
* @return the result of {@code defaultAction} |
|
462 |
*/ |
|
463 |
@Override |
|
10 | 464 |
public R visitNewArray(NewArrayTree node, P p) { |
465 |
return defaultAction(node, p); |
|
466 |
} |
|
467 |
||
25287 | 468 |
/** |
469 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
470 |
* |
|
471 |
* @param node {@inheritDoc} |
|
472 |
* @param p {@inheritDoc} |
|
473 |
* @return the result of {@code defaultAction} |
|
474 |
*/ |
|
475 |
@Override |
|
11141 | 476 |
public R visitLambdaExpression(LambdaExpressionTree node, P p) { |
477 |
return defaultAction(node, p); |
|
478 |
} |
|
479 |
||
25287 | 480 |
/** |
481 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
482 |
* |
|
483 |
* @param node {@inheritDoc} |
|
484 |
* @param p {@inheritDoc} |
|
485 |
* @return the result of {@code defaultAction} |
|
486 |
*/ |
|
487 |
@Override |
|
10 | 488 |
public R visitParenthesized(ParenthesizedTree node, P p) { |
489 |
return defaultAction(node, p); |
|
490 |
} |
|
491 |
||
25287 | 492 |
/** |
493 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
494 |
* |
|
495 |
* @param node {@inheritDoc} |
|
496 |
* @param p {@inheritDoc} |
|
497 |
* @return the result of {@code defaultAction} |
|
498 |
*/ |
|
499 |
@Override |
|
10 | 500 |
public R visitAssignment(AssignmentTree node, P p) { |
501 |
return defaultAction(node, p); |
|
502 |
} |
|
503 |
||
25287 | 504 |
/** |
505 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
506 |
* |
|
507 |
* @param node {@inheritDoc} |
|
508 |
* @param p {@inheritDoc} |
|
509 |
* @return the result of {@code defaultAction} |
|
510 |
*/ |
|
511 |
@Override |
|
10 | 512 |
public R visitCompoundAssignment(CompoundAssignmentTree node, P p) { |
513 |
return defaultAction(node, p); |
|
514 |
} |
|
515 |
||
25287 | 516 |
/** |
517 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
518 |
* |
|
519 |
* @param node {@inheritDoc} |
|
520 |
* @param p {@inheritDoc} |
|
521 |
* @return the result of {@code defaultAction} |
|
522 |
*/ |
|
523 |
@Override |
|
10 | 524 |
public R visitUnary(UnaryTree node, P p) { |
525 |
return defaultAction(node, p); |
|
526 |
} |
|
527 |
||
25287 | 528 |
/** |
529 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
530 |
* |
|
531 |
* @param node {@inheritDoc} |
|
532 |
* @param p {@inheritDoc} |
|
533 |
* @return the result of {@code defaultAction} |
|
534 |
*/ |
|
535 |
@Override |
|
10 | 536 |
public R visitBinary(BinaryTree node, P p) { |
537 |
return defaultAction(node, p); |
|
538 |
} |
|
539 |
||
25287 | 540 |
/** |
541 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
542 |
* |
|
543 |
* @param node {@inheritDoc} |
|
544 |
* @param p {@inheritDoc} |
|
545 |
* @return the result of {@code defaultAction} |
|
546 |
*/ |
|
547 |
@Override |
|
10 | 548 |
public R visitTypeCast(TypeCastTree node, P p) { |
549 |
return defaultAction(node, p); |
|
550 |
} |
|
551 |
||
25287 | 552 |
/** |
553 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
554 |
* |
|
555 |
* @param node {@inheritDoc} |
|
556 |
* @param p {@inheritDoc} |
|
557 |
* @return the result of {@code defaultAction} |
|
558 |
*/ |
|
559 |
@Override |
|
10 | 560 |
public R visitInstanceOf(InstanceOfTree node, P p) { |
561 |
return defaultAction(node, p); |
|
562 |
} |
|
563 |
||
25287 | 564 |
/** |
565 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
566 |
* |
|
567 |
* @param node {@inheritDoc} |
|
568 |
* @param p {@inheritDoc} |
|
569 |
* @return the result of {@code defaultAction} |
|
570 |
*/ |
|
571 |
@Override |
|
10 | 572 |
public R visitArrayAccess(ArrayAccessTree node, P p) { |
573 |
return defaultAction(node, p); |
|
574 |
} |
|
575 |
||
25287 | 576 |
/** |
577 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
578 |
* |
|
579 |
* @param node {@inheritDoc} |
|
580 |
* @param p {@inheritDoc} |
|
581 |
* @return the result of {@code defaultAction} |
|
582 |
*/ |
|
583 |
@Override |
|
10 | 584 |
public R visitMemberSelect(MemberSelectTree node, P p) { |
585 |
return defaultAction(node, p); |
|
586 |
} |
|
587 |
||
25287 | 588 |
/** |
589 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
590 |
* |
|
591 |
* @param node {@inheritDoc} |
|
592 |
* @param p {@inheritDoc} |
|
593 |
* @return the result of {@code defaultAction} |
|
594 |
*/ |
|
595 |
@Override |
|
11142 | 596 |
public R visitMemberReference(MemberReferenceTree node, P p) { |
597 |
return defaultAction(node, p); |
|
598 |
} |
|
599 |
||
25287 | 600 |
/** |
601 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
602 |
* |
|
603 |
* @param node {@inheritDoc} |
|
604 |
* @param p {@inheritDoc} |
|
605 |
* @return the result of {@code defaultAction} |
|
606 |
*/ |
|
607 |
@Override |
|
10 | 608 |
public R visitIdentifier(IdentifierTree node, P p) { |
609 |
return defaultAction(node, p); |
|
610 |
} |
|
611 |
||
25287 | 612 |
/** |
613 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
614 |
* |
|
615 |
* @param node {@inheritDoc} |
|
616 |
* @param p {@inheritDoc} |
|
617 |
* @return the result of {@code defaultAction} |
|
618 |
*/ |
|
619 |
@Override |
|
10 | 620 |
public R visitLiteral(LiteralTree node, P p) { |
621 |
return defaultAction(node, p); |
|
622 |
} |
|
623 |
||
25287 | 624 |
/** |
625 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
626 |
* |
|
627 |
* @param node {@inheritDoc} |
|
628 |
* @param p {@inheritDoc} |
|
629 |
* @return the result of {@code defaultAction} |
|
630 |
*/ |
|
631 |
@Override |
|
10 | 632 |
public R visitPrimitiveType(PrimitiveTypeTree node, P p) { |
633 |
return defaultAction(node, p); |
|
634 |
} |
|
635 |
||
25287 | 636 |
/** |
637 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
638 |
* |
|
639 |
* @param node {@inheritDoc} |
|
640 |
* @param p {@inheritDoc} |
|
641 |
* @return the result of {@code defaultAction} |
|
642 |
*/ |
|
643 |
@Override |
|
10 | 644 |
public R visitArrayType(ArrayTypeTree node, P p) { |
645 |
return defaultAction(node, p); |
|
646 |
} |
|
647 |
||
25287 | 648 |
/** |
649 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
650 |
* |
|
651 |
* @param node {@inheritDoc} |
|
652 |
* @param p {@inheritDoc} |
|
653 |
* @return the result of {@code defaultAction} |
|
654 |
*/ |
|
655 |
@Override |
|
10 | 656 |
public R visitParameterizedType(ParameterizedTypeTree node, P p) { |
657 |
return defaultAction(node, p); |
|
658 |
} |
|
659 |
||
25287 | 660 |
/** |
661 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
662 |
* |
|
663 |
* @param node {@inheritDoc} |
|
664 |
* @param p {@inheritDoc} |
|
665 |
* @return the result of {@code defaultAction} |
|
666 |
*/ |
|
667 |
@Override |
|
9300
c2de4dd9853b
7033809: Rename "disjunctive" to "union" in javax.lang.model
darcy
parents:
8031
diff
changeset
|
668 |
public R visitUnionType(UnionTypeTree node, P p) { |
5492
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
669 |
return defaultAction(node, p); |
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
670 |
} |
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
671 |
|
25287 | 672 |
/** |
673 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
674 |
* |
|
675 |
* @param node {@inheritDoc} |
|
676 |
* @param p {@inheritDoc} |
|
677 |
* @return the result of {@code defaultAction} |
|
678 |
*/ |
|
679 |
@Override |
|
14725
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
11142
diff
changeset
|
680 |
public R visitIntersectionType(IntersectionTypeTree node, P p) { |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
11142
diff
changeset
|
681 |
return defaultAction(node, p); |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
11142
diff
changeset
|
682 |
} |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
11142
diff
changeset
|
683 |
|
25287 | 684 |
/** |
685 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
686 |
* |
|
687 |
* @param node {@inheritDoc} |
|
688 |
* @param p {@inheritDoc} |
|
689 |
* @return the result of {@code defaultAction} |
|
690 |
*/ |
|
691 |
@Override |
|
10 | 692 |
public R visitTypeParameter(TypeParameterTree node, P p) { |
693 |
return defaultAction(node, p); |
|
694 |
} |
|
695 |
||
25287 | 696 |
/** |
697 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
698 |
* |
|
699 |
* @param node {@inheritDoc} |
|
700 |
* @param p {@inheritDoc} |
|
701 |
* @return the result of {@code defaultAction} |
|
702 |
*/ |
|
703 |
@Override |
|
10 | 704 |
public R visitWildcard(WildcardTree node, P p) { |
705 |
return defaultAction(node, p); |
|
706 |
} |
|
707 |
||
25287 | 708 |
/** |
709 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
710 |
* |
|
711 |
* @param node {@inheritDoc} |
|
712 |
* @param p {@inheritDoc} |
|
713 |
* @return the result of {@code defaultAction} |
|
714 |
*/ |
|
715 |
@Override |
|
10 | 716 |
public R visitModifiers(ModifiersTree node, P p) { |
717 |
return defaultAction(node, p); |
|
718 |
} |
|
719 |
||
25287 | 720 |
/** |
721 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
722 |
* |
|
723 |
* @param node {@inheritDoc} |
|
724 |
* @param p {@inheritDoc} |
|
725 |
* @return the result of {@code defaultAction} |
|
726 |
*/ |
|
727 |
@Override |
|
10 | 728 |
public R visitAnnotation(AnnotationTree node, P p) { |
729 |
return defaultAction(node, p); |
|
730 |
} |
|
731 |
||
25287 | 732 |
/** |
733 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
734 |
* |
|
735 |
* @param node {@inheritDoc} |
|
736 |
* @param p {@inheritDoc} |
|
737 |
* @return the result of {@code defaultAction} |
|
738 |
*/ |
|
739 |
@Override |
|
15385 | 740 |
public R visitAnnotatedType(AnnotatedTypeTree node, P p) { |
741 |
return defaultAction(node, p); |
|
742 |
} |
|
743 |
||
36526 | 744 |
public R visitModule(ModuleTree node, P p) { |
745 |
return defaultAction(node, p); |
|
746 |
} |
|
747 |
||
748 |
@Override |
|
749 |
public R visitExports(ExportsTree node, P p) { |
|
750 |
return defaultAction(node, p); |
|
751 |
} |
|
752 |
||
25287 | 753 |
@Override |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
754 |
public R visitOpens(OpensTree node, P p) { |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
755 |
return defaultAction(node, p); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
756 |
} |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
757 |
|
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
758 |
@Override |
36526 | 759 |
public R visitProvides(ProvidesTree node, P p) { |
760 |
return defaultAction(node, p); |
|
761 |
} |
|
762 |
||
763 |
@Override |
|
764 |
public R visitRequires(RequiresTree node, P p) { |
|
765 |
return defaultAction(node, p); |
|
766 |
} |
|
767 |
||
768 |
@Override |
|
769 |
public R visitUses(UsesTree node, P p) { |
|
770 |
return defaultAction(node, p); |
|
771 |
} |
|
772 |
||
10 | 773 |
public R visitErroneous(ErroneousTree node, P p) { |
774 |
return defaultAction(node, p); |
|
775 |
} |
|
776 |
||
25287 | 777 |
/** |
778 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
779 |
* |
|
780 |
* @param node {@inheritDoc} |
|
781 |
* @param p {@inheritDoc} |
|
782 |
* @return the result of {@code defaultAction} |
|
783 |
*/ |
|
784 |
@Override |
|
10 | 785 |
public R visitOther(Tree node, P p) { |
786 |
return defaultAction(node, p); |
|
787 |
} |
|
55306 | 788 |
|
789 |
/** |
|
790 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
791 |
* |
|
792 |
* @param node {@inheritDoc} |
|
793 |
* @param p {@inheritDoc} |
|
794 |
* @return the result of {@code defaultAction} |
|
795 |
*/ |
|
796 |
@Override |
|
58109
ee07de0d2c16
Updating javac behavior w.r.t. preview API. Based on darcy's patch.
jlahoda
parents:
55306
diff
changeset
|
797 |
@jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.SWITCH_EXPRESSIONS) |
ee07de0d2c16
Updating javac behavior w.r.t. preview API. Based on darcy's patch.
jlahoda
parents:
55306
diff
changeset
|
798 |
@SuppressWarnings("preview") |
55306 | 799 |
public R visitYield(YieldTree node, P p) { |
800 |
return defaultAction(node, p); |
|
801 |
} |
|
10 | 802 |
} |