author | jlahoda |
Wed, 27 Nov 2019 09:00:01 +0100 | |
changeset 59285 | 7799a51dbe30 |
parent 59021 | cfc7bb9a5a92 |
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 |
/** |
267 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
268 |
* |
|
269 |
* @param node {@inheritDoc} |
|
270 |
* @param p {@inheritDoc} |
|
271 |
* @return the result of {@code defaultAction} |
|
51563
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
272 |
*/ |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
273 |
@Override |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
274 |
public R visitSwitchExpression(SwitchExpressionTree node, P p) { |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
275 |
return defaultAction(node, p); |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
276 |
} |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
277 |
|
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
278 |
/** |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
279 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
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 |
* @param node {@inheritDoc} |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
282 |
* @param p {@inheritDoc} |
de411d537aae
8206986: Compiler support for Switch Expressions (Preview)
jlahoda
parents:
47216
diff
changeset
|
283 |
* @return the result of {@code defaultAction} |
25287 | 284 |
*/ |
285 |
@Override |
|
10 | 286 |
public R visitCase(CaseTree node, P p) { |
287 |
return defaultAction(node, p); |
|
288 |
} |
|
289 |
||
25287 | 290 |
/** |
291 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
292 |
* |
|
293 |
* @param node {@inheritDoc} |
|
294 |
* @param p {@inheritDoc} |
|
295 |
* @return the result of {@code defaultAction} |
|
296 |
*/ |
|
297 |
@Override |
|
10 | 298 |
public R visitSynchronized(SynchronizedTree node, P p) { |
299 |
return defaultAction(node, p); |
|
300 |
} |
|
301 |
||
25287 | 302 |
/** |
303 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
304 |
* |
|
305 |
* @param node {@inheritDoc} |
|
306 |
* @param p {@inheritDoc} |
|
307 |
* @return the result of {@code defaultAction} |
|
308 |
*/ |
|
309 |
@Override |
|
10 | 310 |
public R visitTry(TryTree node, P p) { |
311 |
return defaultAction(node, p); |
|
312 |
} |
|
313 |
||
25287 | 314 |
/** |
315 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
316 |
* |
|
317 |
* @param node {@inheritDoc} |
|
318 |
* @param p {@inheritDoc} |
|
319 |
* @return the result of {@code defaultAction} |
|
320 |
*/ |
|
321 |
@Override |
|
10 | 322 |
public R visitCatch(CatchTree node, P p) { |
323 |
return defaultAction(node, p); |
|
324 |
} |
|
325 |
||
25287 | 326 |
/** |
327 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
328 |
* |
|
329 |
* @param node {@inheritDoc} |
|
330 |
* @param p {@inheritDoc} |
|
331 |
* @return the result of {@code defaultAction} |
|
332 |
*/ |
|
333 |
@Override |
|
10 | 334 |
public R visitConditionalExpression(ConditionalExpressionTree node, P p) { |
335 |
return defaultAction(node, p); |
|
336 |
} |
|
337 |
||
25287 | 338 |
/** |
339 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
340 |
* |
|
341 |
* @param node {@inheritDoc} |
|
342 |
* @param p {@inheritDoc} |
|
343 |
* @return the result of {@code defaultAction} |
|
344 |
*/ |
|
345 |
@Override |
|
10 | 346 |
public R visitIf(IfTree node, P p) { |
347 |
return defaultAction(node, p); |
|
348 |
} |
|
349 |
||
25287 | 350 |
/** |
351 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
352 |
* |
|
353 |
* @param node {@inheritDoc} |
|
354 |
* @param p {@inheritDoc} |
|
355 |
* @return the result of {@code defaultAction} |
|
356 |
*/ |
|
357 |
@Override |
|
10 | 358 |
public R visitExpressionStatement(ExpressionStatementTree node, P p) { |
359 |
return defaultAction(node, p); |
|
360 |
} |
|
361 |
||
25287 | 362 |
/** |
363 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
364 |
* |
|
365 |
* @param node {@inheritDoc} |
|
366 |
* @param p {@inheritDoc} |
|
367 |
* @return the result of {@code defaultAction} |
|
368 |
*/ |
|
369 |
@Override |
|
10 | 370 |
public R visitBreak(BreakTree node, P p) { |
371 |
return defaultAction(node, p); |
|
372 |
} |
|
373 |
||
25287 | 374 |
/** |
375 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
376 |
* |
|
377 |
* @param node {@inheritDoc} |
|
378 |
* @param p {@inheritDoc} |
|
379 |
* @return the result of {@code defaultAction} |
|
380 |
*/ |
|
381 |
@Override |
|
10 | 382 |
public R visitContinue(ContinueTree node, P p) { |
383 |
return defaultAction(node, p); |
|
384 |
} |
|
385 |
||
25287 | 386 |
/** |
387 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
388 |
* |
|
389 |
* @param node {@inheritDoc} |
|
390 |
* @param p {@inheritDoc} |
|
391 |
* @return the result of {@code defaultAction} |
|
392 |
*/ |
|
393 |
@Override |
|
10 | 394 |
public R visitReturn(ReturnTree node, P p) { |
395 |
return defaultAction(node, p); |
|
396 |
} |
|
397 |
||
25287 | 398 |
/** |
399 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
400 |
* |
|
401 |
* @param node {@inheritDoc} |
|
402 |
* @param p {@inheritDoc} |
|
403 |
* @return the result of {@code defaultAction} |
|
404 |
*/ |
|
405 |
@Override |
|
10 | 406 |
public R visitThrow(ThrowTree node, P p) { |
407 |
return defaultAction(node, p); |
|
408 |
} |
|
409 |
||
25287 | 410 |
/** |
411 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
412 |
* |
|
413 |
* @param node {@inheritDoc} |
|
414 |
* @param p {@inheritDoc} |
|
415 |
* @return the result of {@code defaultAction} |
|
416 |
*/ |
|
417 |
@Override |
|
10 | 418 |
public R visitAssert(AssertTree node, P p) { |
419 |
return defaultAction(node, p); |
|
420 |
} |
|
421 |
||
25287 | 422 |
/** |
423 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
424 |
* |
|
425 |
* @param node {@inheritDoc} |
|
426 |
* @param p {@inheritDoc} |
|
427 |
* @return the result of {@code defaultAction} |
|
428 |
*/ |
|
429 |
@Override |
|
10 | 430 |
public R visitMethodInvocation(MethodInvocationTree node, P p) { |
431 |
return defaultAction(node, p); |
|
432 |
} |
|
433 |
||
25287 | 434 |
/** |
435 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
436 |
* |
|
437 |
* @param node {@inheritDoc} |
|
438 |
* @param p {@inheritDoc} |
|
439 |
* @return the result of {@code defaultAction} |
|
440 |
*/ |
|
441 |
@Override |
|
10 | 442 |
public R visitNewClass(NewClassTree node, P p) { |
443 |
return defaultAction(node, p); |
|
444 |
} |
|
445 |
||
25287 | 446 |
/** |
447 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
448 |
* |
|
449 |
* @param node {@inheritDoc} |
|
450 |
* @param p {@inheritDoc} |
|
451 |
* @return the result of {@code defaultAction} |
|
452 |
*/ |
|
453 |
@Override |
|
10 | 454 |
public R visitNewArray(NewArrayTree node, P p) { |
455 |
return defaultAction(node, p); |
|
456 |
} |
|
457 |
||
25287 | 458 |
/** |
459 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
460 |
* |
|
461 |
* @param node {@inheritDoc} |
|
462 |
* @param p {@inheritDoc} |
|
463 |
* @return the result of {@code defaultAction} |
|
464 |
*/ |
|
465 |
@Override |
|
11141 | 466 |
public R visitLambdaExpression(LambdaExpressionTree node, P p) { |
467 |
return defaultAction(node, p); |
|
468 |
} |
|
469 |
||
25287 | 470 |
/** |
471 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
472 |
* |
|
473 |
* @param node {@inheritDoc} |
|
474 |
* @param p {@inheritDoc} |
|
475 |
* @return the result of {@code defaultAction} |
|
476 |
*/ |
|
477 |
@Override |
|
10 | 478 |
public R visitParenthesized(ParenthesizedTree node, P p) { |
479 |
return defaultAction(node, p); |
|
480 |
} |
|
481 |
||
25287 | 482 |
/** |
483 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
484 |
* |
|
485 |
* @param node {@inheritDoc} |
|
486 |
* @param p {@inheritDoc} |
|
487 |
* @return the result of {@code defaultAction} |
|
488 |
*/ |
|
489 |
@Override |
|
10 | 490 |
public R visitAssignment(AssignmentTree node, P p) { |
491 |
return defaultAction(node, p); |
|
492 |
} |
|
493 |
||
25287 | 494 |
/** |
495 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
496 |
* |
|
497 |
* @param node {@inheritDoc} |
|
498 |
* @param p {@inheritDoc} |
|
499 |
* @return the result of {@code defaultAction} |
|
500 |
*/ |
|
501 |
@Override |
|
10 | 502 |
public R visitCompoundAssignment(CompoundAssignmentTree node, P p) { |
503 |
return defaultAction(node, p); |
|
504 |
} |
|
505 |
||
25287 | 506 |
/** |
507 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
508 |
* |
|
509 |
* @param node {@inheritDoc} |
|
510 |
* @param p {@inheritDoc} |
|
511 |
* @return the result of {@code defaultAction} |
|
512 |
*/ |
|
513 |
@Override |
|
10 | 514 |
public R visitUnary(UnaryTree node, P p) { |
515 |
return defaultAction(node, p); |
|
516 |
} |
|
517 |
||
25287 | 518 |
/** |
519 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
520 |
* |
|
521 |
* @param node {@inheritDoc} |
|
522 |
* @param p {@inheritDoc} |
|
523 |
* @return the result of {@code defaultAction} |
|
524 |
*/ |
|
525 |
@Override |
|
10 | 526 |
public R visitBinary(BinaryTree node, P p) { |
527 |
return defaultAction(node, p); |
|
528 |
} |
|
529 |
||
25287 | 530 |
/** |
531 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
532 |
* |
|
533 |
* @param node {@inheritDoc} |
|
534 |
* @param p {@inheritDoc} |
|
535 |
* @return the result of {@code defaultAction} |
|
536 |
*/ |
|
537 |
@Override |
|
10 | 538 |
public R visitTypeCast(TypeCastTree node, P p) { |
539 |
return defaultAction(node, p); |
|
540 |
} |
|
541 |
||
25287 | 542 |
/** |
543 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
544 |
* |
|
545 |
* @param node {@inheritDoc} |
|
546 |
* @param p {@inheritDoc} |
|
547 |
* @return the result of {@code defaultAction} |
|
548 |
*/ |
|
549 |
@Override |
|
10 | 550 |
public R visitInstanceOf(InstanceOfTree node, P p) { |
551 |
return defaultAction(node, p); |
|
552 |
} |
|
553 |
||
25287 | 554 |
/** |
555 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
556 |
* |
|
557 |
* @param node {@inheritDoc} |
|
558 |
* @param p {@inheritDoc} |
|
559 |
* @return the result of {@code defaultAction} |
|
59285
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
560 |
* @since 14 |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
561 |
*/ |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
562 |
@Override |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
563 |
public R visitBindingPattern(BindingPatternTree node, P p) { |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
564 |
return defaultAction(node, p); |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
565 |
} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
566 |
|
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
567 |
/** |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
568 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
569 |
* |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
570 |
* @param node {@inheritDoc} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
571 |
* @param p {@inheritDoc} |
7799a51dbe30
8231826: Implement javac changes for pattern matching for instanceof
jlahoda
parents:
59021
diff
changeset
|
572 |
* @return the result of {@code defaultAction} |
25287 | 573 |
*/ |
574 |
@Override |
|
10 | 575 |
public R visitArrayAccess(ArrayAccessTree node, P p) { |
576 |
return defaultAction(node, p); |
|
577 |
} |
|
578 |
||
25287 | 579 |
/** |
580 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
581 |
* |
|
582 |
* @param node {@inheritDoc} |
|
583 |
* @param p {@inheritDoc} |
|
584 |
* @return the result of {@code defaultAction} |
|
585 |
*/ |
|
586 |
@Override |
|
10 | 587 |
public R visitMemberSelect(MemberSelectTree node, P p) { |
588 |
return defaultAction(node, p); |
|
589 |
} |
|
590 |
||
25287 | 591 |
/** |
592 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
593 |
* |
|
594 |
* @param node {@inheritDoc} |
|
595 |
* @param p {@inheritDoc} |
|
596 |
* @return the result of {@code defaultAction} |
|
597 |
*/ |
|
598 |
@Override |
|
11142 | 599 |
public R visitMemberReference(MemberReferenceTree node, P p) { |
600 |
return defaultAction(node, p); |
|
601 |
} |
|
602 |
||
25287 | 603 |
/** |
604 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
605 |
* |
|
606 |
* @param node {@inheritDoc} |
|
607 |
* @param p {@inheritDoc} |
|
608 |
* @return the result of {@code defaultAction} |
|
609 |
*/ |
|
610 |
@Override |
|
10 | 611 |
public R visitIdentifier(IdentifierTree node, P p) { |
612 |
return defaultAction(node, p); |
|
613 |
} |
|
614 |
||
25287 | 615 |
/** |
616 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
617 |
* |
|
618 |
* @param node {@inheritDoc} |
|
619 |
* @param p {@inheritDoc} |
|
620 |
* @return the result of {@code defaultAction} |
|
621 |
*/ |
|
622 |
@Override |
|
10 | 623 |
public R visitLiteral(LiteralTree node, P p) { |
624 |
return defaultAction(node, p); |
|
625 |
} |
|
626 |
||
25287 | 627 |
/** |
628 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
629 |
* |
|
630 |
* @param node {@inheritDoc} |
|
631 |
* @param p {@inheritDoc} |
|
632 |
* @return the result of {@code defaultAction} |
|
633 |
*/ |
|
634 |
@Override |
|
10 | 635 |
public R visitPrimitiveType(PrimitiveTypeTree node, P p) { |
636 |
return defaultAction(node, p); |
|
637 |
} |
|
638 |
||
25287 | 639 |
/** |
640 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
641 |
* |
|
642 |
* @param node {@inheritDoc} |
|
643 |
* @param p {@inheritDoc} |
|
644 |
* @return the result of {@code defaultAction} |
|
645 |
*/ |
|
646 |
@Override |
|
10 | 647 |
public R visitArrayType(ArrayTypeTree node, P p) { |
648 |
return defaultAction(node, p); |
|
649 |
} |
|
650 |
||
25287 | 651 |
/** |
652 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
653 |
* |
|
654 |
* @param node {@inheritDoc} |
|
655 |
* @param p {@inheritDoc} |
|
656 |
* @return the result of {@code defaultAction} |
|
657 |
*/ |
|
658 |
@Override |
|
10 | 659 |
public R visitParameterizedType(ParameterizedTypeTree node, P p) { |
660 |
return defaultAction(node, p); |
|
661 |
} |
|
662 |
||
25287 | 663 |
/** |
664 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
665 |
* |
|
666 |
* @param node {@inheritDoc} |
|
667 |
* @param p {@inheritDoc} |
|
668 |
* @return the result of {@code defaultAction} |
|
669 |
*/ |
|
670 |
@Override |
|
9300
c2de4dd9853b
7033809: Rename "disjunctive" to "union" in javax.lang.model
darcy
parents:
8031
diff
changeset
|
671 |
public R visitUnionType(UnionTypeTree node, P p) { |
5492
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
672 |
return defaultAction(node, p); |
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
673 |
} |
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
674 |
|
25287 | 675 |
/** |
676 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
677 |
* |
|
678 |
* @param node {@inheritDoc} |
|
679 |
* @param p {@inheritDoc} |
|
680 |
* @return the result of {@code defaultAction} |
|
681 |
*/ |
|
682 |
@Override |
|
14725
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
11142
diff
changeset
|
683 |
public R visitIntersectionType(IntersectionTypeTree node, P p) { |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
11142
diff
changeset
|
684 |
return defaultAction(node, p); |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
11142
diff
changeset
|
685 |
} |
65836e833f59
8002099: Add support for intersection types in cast expression
mcimadamore
parents:
11142
diff
changeset
|
686 |
|
25287 | 687 |
/** |
688 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
689 |
* |
|
690 |
* @param node {@inheritDoc} |
|
691 |
* @param p {@inheritDoc} |
|
692 |
* @return the result of {@code defaultAction} |
|
693 |
*/ |
|
694 |
@Override |
|
10 | 695 |
public R visitTypeParameter(TypeParameterTree node, P p) { |
696 |
return defaultAction(node, p); |
|
697 |
} |
|
698 |
||
25287 | 699 |
/** |
700 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
701 |
* |
|
702 |
* @param node {@inheritDoc} |
|
703 |
* @param p {@inheritDoc} |
|
704 |
* @return the result of {@code defaultAction} |
|
705 |
*/ |
|
706 |
@Override |
|
10 | 707 |
public R visitWildcard(WildcardTree node, P p) { |
708 |
return defaultAction(node, p); |
|
709 |
} |
|
710 |
||
25287 | 711 |
/** |
712 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
713 |
* |
|
714 |
* @param node {@inheritDoc} |
|
715 |
* @param p {@inheritDoc} |
|
716 |
* @return the result of {@code defaultAction} |
|
717 |
*/ |
|
718 |
@Override |
|
10 | 719 |
public R visitModifiers(ModifiersTree node, P p) { |
720 |
return defaultAction(node, p); |
|
721 |
} |
|
722 |
||
25287 | 723 |
/** |
724 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
725 |
* |
|
726 |
* @param node {@inheritDoc} |
|
727 |
* @param p {@inheritDoc} |
|
728 |
* @return the result of {@code defaultAction} |
|
729 |
*/ |
|
730 |
@Override |
|
10 | 731 |
public R visitAnnotation(AnnotationTree node, P p) { |
732 |
return defaultAction(node, p); |
|
733 |
} |
|
734 |
||
25287 | 735 |
/** |
736 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
737 |
* |
|
738 |
* @param node {@inheritDoc} |
|
739 |
* @param p {@inheritDoc} |
|
740 |
* @return the result of {@code defaultAction} |
|
741 |
*/ |
|
742 |
@Override |
|
15385 | 743 |
public R visitAnnotatedType(AnnotatedTypeTree node, P p) { |
744 |
return defaultAction(node, p); |
|
745 |
} |
|
746 |
||
36526 | 747 |
public R visitModule(ModuleTree node, P p) { |
748 |
return defaultAction(node, p); |
|
749 |
} |
|
750 |
||
751 |
@Override |
|
752 |
public R visitExports(ExportsTree node, P p) { |
|
753 |
return defaultAction(node, p); |
|
754 |
} |
|
755 |
||
25287 | 756 |
@Override |
42407
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
757 |
public R visitOpens(OpensTree node, P p) { |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
758 |
return defaultAction(node, p); |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
759 |
} |
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
760 |
|
f3702cff2933
8169069: Module system implementation refresh (11/2016)
alanb
parents:
36526
diff
changeset
|
761 |
@Override |
36526 | 762 |
public R visitProvides(ProvidesTree node, P p) { |
763 |
return defaultAction(node, p); |
|
764 |
} |
|
765 |
||
766 |
@Override |
|
767 |
public R visitRequires(RequiresTree node, P p) { |
|
768 |
return defaultAction(node, p); |
|
769 |
} |
|
770 |
||
771 |
@Override |
|
772 |
public R visitUses(UsesTree node, P p) { |
|
773 |
return defaultAction(node, p); |
|
774 |
} |
|
775 |
||
10 | 776 |
public R visitErroneous(ErroneousTree node, P p) { |
777 |
return defaultAction(node, p); |
|
778 |
} |
|
779 |
||
25287 | 780 |
/** |
781 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
782 |
* |
|
783 |
* @param node {@inheritDoc} |
|
784 |
* @param p {@inheritDoc} |
|
785 |
* @return the result of {@code defaultAction} |
|
786 |
*/ |
|
787 |
@Override |
|
10 | 788 |
public R visitOther(Tree node, P p) { |
789 |
return defaultAction(node, p); |
|
790 |
} |
|
55306 | 791 |
|
792 |
/** |
|
793 |
* {@inheritDoc} This implementation calls {@code defaultAction}. |
|
794 |
* |
|
795 |
* @param node {@inheritDoc} |
|
796 |
* @param p {@inheritDoc} |
|
797 |
* @return the result of {@code defaultAction} |
|
798 |
*/ |
|
799 |
@Override |
|
800 |
public R visitYield(YieldTree node, P p) { |
|
801 |
return defaultAction(node, p); |
|
802 |
} |
|
10 | 803 |
} |