author | mcimadamore |
Thu, 24 Nov 2011 13:36:20 +0000 | |
changeset 11141 | 7d112a1ecd0f |
parent 9300 | c2de4dd9853b |
child 11142 | 45d0ec1e7463 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
8031 | 2 |
* Copyright (c) 2005, 2011, 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.tree; |
|
27 |
||
28 |
/** |
|
29 |
* Common interface for all nodes in an abstract syntax tree. |
|
30 |
* |
|
31 |
* <p><b>WARNING:</b> This interface and its sub-interfaces are |
|
32 |
* subject to change as the Java™ programming language evolves. |
|
5848
c5a4ce47e780
6960407: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents:
5520
diff
changeset
|
33 |
* These interfaces are implemented by the JDK Java compiler (javac) |
10 | 34 |
* and should not be implemented either directly or indirectly by |
35 |
* other applications. |
|
36 |
* |
|
37 |
* @author Peter von der Ahé |
|
38 |
* @author Jonathan Gibbons |
|
39 |
* |
|
40 |
* @since 1.6 |
|
41 |
*/ |
|
42 |
public interface Tree { |
|
43 |
||
44 |
/** |
|
45 |
* Enumerates all kinds of trees. |
|
46 |
*/ |
|
47 |
public enum Kind { |
|
3149 | 48 |
|
10 | 49 |
/** |
50 |
* Used for instances of {@link AnnotationTree}. |
|
51 |
*/ |
|
52 |
ANNOTATION(AnnotationTree.class), |
|
53 |
||
54 |
/** |
|
55 |
* Used for instances of {@link ArrayAccessTree}. |
|
56 |
*/ |
|
57 |
ARRAY_ACCESS(ArrayAccessTree.class), |
|
58 |
||
59 |
/** |
|
60 |
* Used for instances of {@link ArrayTypeTree}. |
|
61 |
*/ |
|
62 |
ARRAY_TYPE(ArrayTypeTree.class), |
|
63 |
||
64 |
/** |
|
65 |
* Used for instances of {@link AssertTree}. |
|
66 |
*/ |
|
67 |
ASSERT(AssertTree.class), |
|
68 |
||
69 |
/** |
|
70 |
* Used for instances of {@link AssignmentTree}. |
|
71 |
*/ |
|
72 |
ASSIGNMENT(AssignmentTree.class), |
|
73 |
||
74 |
/** |
|
75 |
* Used for instances of {@link BlockTree}. |
|
76 |
*/ |
|
77 |
BLOCK(BlockTree.class), |
|
78 |
||
79 |
/** |
|
80 |
* Used for instances of {@link BreakTree}. |
|
81 |
*/ |
|
82 |
BREAK(BreakTree.class), |
|
83 |
||
84 |
/** |
|
85 |
* Used for instances of {@link CaseTree}. |
|
86 |
*/ |
|
87 |
CASE(CaseTree.class), |
|
88 |
||
89 |
/** |
|
90 |
* Used for instances of {@link CatchTree}. |
|
91 |
*/ |
|
92 |
CATCH(CatchTree.class), |
|
93 |
||
94 |
/** |
|
6580
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
95 |
* Used for instances of {@link ClassTree} representing classes. |
10 | 96 |
*/ |
97 |
CLASS(ClassTree.class), |
|
98 |
||
99 |
/** |
|
100 |
* Used for instances of {@link CompilationUnitTree}. |
|
101 |
*/ |
|
102 |
COMPILATION_UNIT(CompilationUnitTree.class), |
|
103 |
||
104 |
/** |
|
105 |
* Used for instances of {@link ConditionalExpressionTree}. |
|
106 |
*/ |
|
107 |
CONDITIONAL_EXPRESSION(ConditionalExpressionTree.class), |
|
108 |
||
109 |
/** |
|
110 |
* Used for instances of {@link ContinueTree}. |
|
111 |
*/ |
|
112 |
CONTINUE(ContinueTree.class), |
|
113 |
||
114 |
/** |
|
115 |
* Used for instances of {@link DoWhileLoopTree}. |
|
116 |
*/ |
|
117 |
DO_WHILE_LOOP(DoWhileLoopTree.class), |
|
118 |
||
119 |
/** |
|
120 |
* Used for instances of {@link EnhancedForLoopTree}. |
|
121 |
*/ |
|
122 |
ENHANCED_FOR_LOOP(EnhancedForLoopTree.class), |
|
123 |
||
124 |
/** |
|
125 |
* Used for instances of {@link ExpressionStatementTree}. |
|
126 |
*/ |
|
127 |
EXPRESSION_STATEMENT(ExpressionStatementTree.class), |
|
128 |
||
129 |
/** |
|
130 |
* Used for instances of {@link MemberSelectTree}. |
|
131 |
*/ |
|
132 |
MEMBER_SELECT(MemberSelectTree.class), |
|
133 |
||
134 |
/** |
|
135 |
* Used for instances of {@link ForLoopTree}. |
|
136 |
*/ |
|
137 |
FOR_LOOP(ForLoopTree.class), |
|
138 |
||
139 |
/** |
|
140 |
* Used for instances of {@link IdentifierTree}. |
|
141 |
*/ |
|
142 |
IDENTIFIER(IdentifierTree.class), |
|
143 |
||
144 |
/** |
|
145 |
* Used for instances of {@link IfTree}. |
|
146 |
*/ |
|
147 |
IF(IfTree.class), |
|
148 |
||
149 |
/** |
|
150 |
* Used for instances of {@link ImportTree}. |
|
151 |
*/ |
|
152 |
IMPORT(ImportTree.class), |
|
153 |
||
154 |
/** |
|
155 |
* Used for instances of {@link InstanceOfTree}. |
|
156 |
*/ |
|
157 |
INSTANCE_OF(InstanceOfTree.class), |
|
158 |
||
159 |
/** |
|
160 |
* Used for instances of {@link LabeledStatementTree}. |
|
161 |
*/ |
|
162 |
LABELED_STATEMENT(LabeledStatementTree.class), |
|
163 |
||
164 |
/** |
|
165 |
* Used for instances of {@link MethodTree}. |
|
166 |
*/ |
|
167 |
METHOD(MethodTree.class), |
|
168 |
||
169 |
/** |
|
170 |
* Used for instances of {@link MethodInvocationTree}. |
|
171 |
*/ |
|
172 |
METHOD_INVOCATION(MethodInvocationTree.class), |
|
173 |
||
174 |
/** |
|
175 |
* Used for instances of {@link ModifiersTree}. |
|
176 |
*/ |
|
177 |
MODIFIERS(ModifiersTree.class), |
|
178 |
||
179 |
/** |
|
180 |
* Used for instances of {@link NewArrayTree}. |
|
181 |
*/ |
|
182 |
NEW_ARRAY(NewArrayTree.class), |
|
183 |
||
184 |
/** |
|
185 |
* Used for instances of {@link NewClassTree}. |
|
186 |
*/ |
|
187 |
NEW_CLASS(NewClassTree.class), |
|
188 |
||
189 |
/** |
|
11141 | 190 |
* Used for instances of {@link LambdaExpressionTree}. |
191 |
*/ |
|
192 |
LAMBDA_EXPRESSION(LambdaExpressionTree.class), |
|
193 |
||
194 |
/** |
|
10 | 195 |
* Used for instances of {@link ParenthesizedTree}. |
196 |
*/ |
|
197 |
PARENTHESIZED(ParenthesizedTree.class), |
|
198 |
||
199 |
/** |
|
200 |
* Used for instances of {@link PrimitiveTypeTree}. |
|
201 |
*/ |
|
202 |
PRIMITIVE_TYPE(PrimitiveTypeTree.class), |
|
203 |
||
204 |
/** |
|
205 |
* Used for instances of {@link ReturnTree}. |
|
206 |
*/ |
|
207 |
RETURN(ReturnTree.class), |
|
208 |
||
209 |
/** |
|
210 |
* Used for instances of {@link EmptyStatementTree}. |
|
211 |
*/ |
|
212 |
EMPTY_STATEMENT(EmptyStatementTree.class), |
|
213 |
||
214 |
/** |
|
215 |
* Used for instances of {@link SwitchTree}. |
|
216 |
*/ |
|
217 |
SWITCH(SwitchTree.class), |
|
218 |
||
219 |
/** |
|
220 |
* Used for instances of {@link SynchronizedTree}. |
|
221 |
*/ |
|
222 |
SYNCHRONIZED(SynchronizedTree.class), |
|
223 |
||
224 |
/** |
|
225 |
* Used for instances of {@link ThrowTree}. |
|
226 |
*/ |
|
227 |
THROW(ThrowTree.class), |
|
228 |
||
229 |
/** |
|
230 |
* Used for instances of {@link TryTree}. |
|
231 |
*/ |
|
232 |
TRY(TryTree.class), |
|
233 |
||
234 |
/** |
|
235 |
* Used for instances of {@link ParameterizedTypeTree}. |
|
236 |
*/ |
|
237 |
PARAMETERIZED_TYPE(ParameterizedTypeTree.class), |
|
238 |
||
239 |
/** |
|
9300
c2de4dd9853b
7033809: Rename "disjunctive" to "union" in javax.lang.model
darcy
parents:
8031
diff
changeset
|
240 |
* Used for instances of {@link UnionTypeTree}. |
5492
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
241 |
*/ |
9300
c2de4dd9853b
7033809: Rename "disjunctive" to "union" in javax.lang.model
darcy
parents:
8031
diff
changeset
|
242 |
UNION_TYPE(UnionTypeTree.class), |
5492
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
243 |
|
515e4b33b335
6943289: Project Coin: Improved Exception Handling for Java (aka 'multicatch')
mcimadamore
parents:
3149
diff
changeset
|
244 |
/** |
10 | 245 |
* Used for instances of {@link TypeCastTree}. |
246 |
*/ |
|
247 |
TYPE_CAST(TypeCastTree.class), |
|
248 |
||
249 |
/** |
|
250 |
* Used for instances of {@link TypeParameterTree}. |
|
251 |
*/ |
|
252 |
TYPE_PARAMETER(TypeParameterTree.class), |
|
253 |
||
254 |
/** |
|
255 |
* Used for instances of {@link VariableTree}. |
|
256 |
*/ |
|
257 |
VARIABLE(VariableTree.class), |
|
258 |
||
259 |
/** |
|
260 |
* Used for instances of {@link WhileLoopTree}. |
|
261 |
*/ |
|
262 |
WHILE_LOOP(WhileLoopTree.class), |
|
263 |
||
264 |
/** |
|
265 |
* Used for instances of {@link UnaryTree} representing postfix |
|
266 |
* increment operator {@code ++}. |
|
267 |
*/ |
|
268 |
POSTFIX_INCREMENT(UnaryTree.class), |
|
269 |
||
270 |
/** |
|
271 |
* Used for instances of {@link UnaryTree} representing postfix |
|
272 |
* decrement operator {@code --}. |
|
273 |
*/ |
|
274 |
POSTFIX_DECREMENT(UnaryTree.class), |
|
275 |
||
276 |
/** |
|
277 |
* Used for instances of {@link UnaryTree} representing prefix |
|
278 |
* increment operator {@code ++}. |
|
279 |
*/ |
|
280 |
PREFIX_INCREMENT(UnaryTree.class), |
|
281 |
||
282 |
/** |
|
283 |
* Used for instances of {@link UnaryTree} representing prefix |
|
284 |
* decrement operator {@code --}. |
|
285 |
*/ |
|
286 |
PREFIX_DECREMENT(UnaryTree.class), |
|
287 |
||
288 |
/** |
|
289 |
* Used for instances of {@link UnaryTree} representing unary plus |
|
290 |
* operator {@code +}. |
|
291 |
*/ |
|
292 |
UNARY_PLUS(UnaryTree.class), |
|
293 |
||
294 |
/** |
|
295 |
* Used for instances of {@link UnaryTree} representing unary minus |
|
296 |
* operator {@code -}. |
|
297 |
*/ |
|
298 |
UNARY_MINUS(UnaryTree.class), |
|
299 |
||
300 |
/** |
|
301 |
* Used for instances of {@link UnaryTree} representing bitwise |
|
302 |
* complement operator {@code ~}. |
|
303 |
*/ |
|
304 |
BITWISE_COMPLEMENT(UnaryTree.class), |
|
305 |
||
306 |
/** |
|
307 |
* Used for instances of {@link UnaryTree} representing logical |
|
308 |
* complement operator {@code !}. |
|
309 |
*/ |
|
310 |
LOGICAL_COMPLEMENT(UnaryTree.class), |
|
311 |
||
312 |
/** |
|
313 |
* Used for instances of {@link BinaryTree} representing |
|
314 |
* multiplication {@code *}. |
|
315 |
*/ |
|
316 |
MULTIPLY(BinaryTree.class), |
|
317 |
||
318 |
/** |
|
319 |
* Used for instances of {@link BinaryTree} representing |
|
320 |
* division {@code /}. |
|
321 |
*/ |
|
322 |
DIVIDE(BinaryTree.class), |
|
323 |
||
324 |
/** |
|
325 |
* Used for instances of {@link BinaryTree} representing |
|
326 |
* remainder {@code %}. |
|
327 |
*/ |
|
328 |
REMAINDER(BinaryTree.class), |
|
329 |
||
330 |
/** |
|
331 |
* Used for instances of {@link BinaryTree} representing |
|
332 |
* addition or string concatenation {@code +}. |
|
333 |
*/ |
|
334 |
PLUS(BinaryTree.class), |
|
335 |
||
336 |
/** |
|
337 |
* Used for instances of {@link BinaryTree} representing |
|
338 |
* subtraction {@code -}. |
|
339 |
*/ |
|
340 |
MINUS(BinaryTree.class), |
|
341 |
||
342 |
/** |
|
343 |
* Used for instances of {@link BinaryTree} representing |
|
344 |
* left shift {@code <<}. |
|
345 |
*/ |
|
346 |
LEFT_SHIFT(BinaryTree.class), |
|
347 |
||
348 |
/** |
|
349 |
* Used for instances of {@link BinaryTree} representing |
|
350 |
* right shift {@code >>}. |
|
351 |
*/ |
|
352 |
RIGHT_SHIFT(BinaryTree.class), |
|
353 |
||
354 |
/** |
|
355 |
* Used for instances of {@link BinaryTree} representing |
|
356 |
* unsigned right shift {@code >>>}. |
|
357 |
*/ |
|
358 |
UNSIGNED_RIGHT_SHIFT(BinaryTree.class), |
|
359 |
||
360 |
/** |
|
361 |
* Used for instances of {@link BinaryTree} representing |
|
362 |
* less-than {@code <}. |
|
363 |
*/ |
|
364 |
LESS_THAN(BinaryTree.class), |
|
365 |
||
366 |
/** |
|
367 |
* Used for instances of {@link BinaryTree} representing |
|
368 |
* greater-than {@code >}. |
|
369 |
*/ |
|
370 |
GREATER_THAN(BinaryTree.class), |
|
371 |
||
372 |
/** |
|
373 |
* Used for instances of {@link BinaryTree} representing |
|
374 |
* less-than-equal {@code <=}. |
|
375 |
*/ |
|
376 |
LESS_THAN_EQUAL(BinaryTree.class), |
|
377 |
||
378 |
/** |
|
379 |
* Used for instances of {@link BinaryTree} representing |
|
380 |
* greater-than-equal {@code >=}. |
|
381 |
*/ |
|
382 |
GREATER_THAN_EQUAL(BinaryTree.class), |
|
383 |
||
384 |
/** |
|
385 |
* Used for instances of {@link BinaryTree} representing |
|
386 |
* equal-to {@code ==}. |
|
387 |
*/ |
|
388 |
EQUAL_TO(BinaryTree.class), |
|
389 |
||
390 |
/** |
|
391 |
* Used for instances of {@link BinaryTree} representing |
|
392 |
* not-equal-to {@code !=}. |
|
393 |
*/ |
|
394 |
NOT_EQUAL_TO(BinaryTree.class), |
|
395 |
||
396 |
/** |
|
397 |
* Used for instances of {@link BinaryTree} representing |
|
398 |
* bitwise and logical "and" {@code &}. |
|
399 |
*/ |
|
400 |
AND(BinaryTree.class), |
|
401 |
||
402 |
/** |
|
403 |
* Used for instances of {@link BinaryTree} representing |
|
404 |
* bitwise and logical "xor" {@code ^}. |
|
405 |
*/ |
|
406 |
XOR(BinaryTree.class), |
|
407 |
||
408 |
/** |
|
409 |
* Used for instances of {@link BinaryTree} representing |
|
410 |
* bitwise and logical "or" {@code |}. |
|
411 |
*/ |
|
412 |
OR(BinaryTree.class), |
|
413 |
||
414 |
/** |
|
415 |
* Used for instances of {@link BinaryTree} representing |
|
416 |
* conditional-and {@code &&}. |
|
417 |
*/ |
|
418 |
CONDITIONAL_AND(BinaryTree.class), |
|
419 |
||
420 |
/** |
|
421 |
* Used for instances of {@link BinaryTree} representing |
|
422 |
* conditional-or {@code ||}. |
|
423 |
*/ |
|
424 |
CONDITIONAL_OR(BinaryTree.class), |
|
425 |
||
426 |
/** |
|
427 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
428 |
* multiplication assignment {@code *=}. |
|
429 |
*/ |
|
430 |
MULTIPLY_ASSIGNMENT(CompoundAssignmentTree.class), |
|
431 |
||
432 |
/** |
|
433 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
434 |
* division assignment {@code /=}. |
|
435 |
*/ |
|
436 |
DIVIDE_ASSIGNMENT(CompoundAssignmentTree.class), |
|
437 |
||
438 |
/** |
|
439 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
440 |
* remainder assignment {@code %=}. |
|
441 |
*/ |
|
442 |
REMAINDER_ASSIGNMENT(CompoundAssignmentTree.class), |
|
443 |
||
444 |
/** |
|
445 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
446 |
* addition or string concatenation assignment {@code +=}. |
|
447 |
*/ |
|
448 |
PLUS_ASSIGNMENT(CompoundAssignmentTree.class), |
|
449 |
||
450 |
/** |
|
451 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
452 |
* subtraction assignment {@code -=}. |
|
453 |
*/ |
|
454 |
MINUS_ASSIGNMENT(CompoundAssignmentTree.class), |
|
455 |
||
456 |
/** |
|
457 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
458 |
* left shift assignment {@code <<=}. |
|
459 |
*/ |
|
460 |
LEFT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class), |
|
461 |
||
462 |
/** |
|
463 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
464 |
* right shift assignment {@code >>=}. |
|
465 |
*/ |
|
466 |
RIGHT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class), |
|
467 |
||
468 |
/** |
|
469 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
470 |
* unsigned right shift assignment {@code >>>=}. |
|
471 |
*/ |
|
472 |
UNSIGNED_RIGHT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class), |
|
473 |
||
474 |
/** |
|
475 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
476 |
* bitwise and logical "and" assignment {@code &=}. |
|
477 |
*/ |
|
478 |
AND_ASSIGNMENT(CompoundAssignmentTree.class), |
|
479 |
||
480 |
/** |
|
481 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
482 |
* bitwise and logical "xor" assignment {@code ^=}. |
|
483 |
*/ |
|
484 |
XOR_ASSIGNMENT(CompoundAssignmentTree.class), |
|
485 |
||
486 |
/** |
|
487 |
* Used for instances of {@link CompoundAssignmentTree} representing |
|
488 |
* bitwise and logical "or" assignment {@code |=}. |
|
489 |
*/ |
|
490 |
OR_ASSIGNMENT(CompoundAssignmentTree.class), |
|
491 |
||
492 |
/** |
|
493 |
* Used for instances of {@link LiteralTree} representing |
|
494 |
* an integral literal expression of type {@code int}. |
|
495 |
*/ |
|
496 |
INT_LITERAL(LiteralTree.class), |
|
497 |
||
498 |
/** |
|
499 |
* Used for instances of {@link LiteralTree} representing |
|
500 |
* an integral literal expression of type {@code long}. |
|
501 |
*/ |
|
502 |
LONG_LITERAL(LiteralTree.class), |
|
503 |
||
504 |
/** |
|
505 |
* Used for instances of {@link LiteralTree} representing |
|
506 |
* a floating-point literal expression of type {@code float}. |
|
507 |
*/ |
|
508 |
FLOAT_LITERAL(LiteralTree.class), |
|
509 |
||
510 |
/** |
|
511 |
* Used for instances of {@link LiteralTree} representing |
|
512 |
* a floating-point literal expression of type {@code double}. |
|
513 |
*/ |
|
514 |
DOUBLE_LITERAL(LiteralTree.class), |
|
515 |
||
516 |
/** |
|
517 |
* Used for instances of {@link LiteralTree} representing |
|
518 |
* a boolean literal expression of type {@code boolean}. |
|
519 |
*/ |
|
520 |
BOOLEAN_LITERAL(LiteralTree.class), |
|
521 |
||
522 |
/** |
|
523 |
* Used for instances of {@link LiteralTree} representing |
|
524 |
* a character literal expression of type {@code char}. |
|
525 |
*/ |
|
526 |
CHAR_LITERAL(LiteralTree.class), |
|
527 |
||
528 |
/** |
|
529 |
* Used for instances of {@link LiteralTree} representing |
|
530 |
* a string literal expression of type {@link String}. |
|
531 |
*/ |
|
532 |
STRING_LITERAL(LiteralTree.class), |
|
533 |
||
534 |
/** |
|
535 |
* Used for instances of {@link LiteralTree} representing |
|
536 |
* the use of {@code null}. |
|
537 |
*/ |
|
538 |
NULL_LITERAL(LiteralTree.class), |
|
539 |
||
540 |
/** |
|
541 |
* Used for instances of {@link WildcardTree} representing |
|
542 |
* an unbounded wildcard type argument. |
|
543 |
*/ |
|
544 |
UNBOUNDED_WILDCARD(WildcardTree.class), |
|
545 |
||
546 |
/** |
|
547 |
* Used for instances of {@link WildcardTree} representing |
|
548 |
* an extends bounded wildcard type argument. |
|
549 |
*/ |
|
550 |
EXTENDS_WILDCARD(WildcardTree.class), |
|
551 |
||
552 |
/** |
|
553 |
* Used for instances of {@link WildcardTree} representing |
|
554 |
* a super bounded wildcard type argument. |
|
555 |
*/ |
|
556 |
SUPER_WILDCARD(WildcardTree.class), |
|
557 |
||
558 |
/** |
|
559 |
* Used for instances of {@link ErroneousTree}. |
|
560 |
*/ |
|
561 |
ERRONEOUS(ErroneousTree.class), |
|
562 |
||
563 |
/** |
|
6580
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
564 |
* Used for instances of {@link ClassTree} representing interfaces. |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
565 |
*/ |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
566 |
INTERFACE(ClassTree.class), |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
567 |
|
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
568 |
/** |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
569 |
* Used for instances of {@link ClassTree} representing enums. |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
570 |
*/ |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
571 |
ENUM(ClassTree.class), |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
572 |
|
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
573 |
/** |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
574 |
* Used for instances of {@link ClassTree} representing annotation types. |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
575 |
*/ |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
576 |
ANNOTATION_TYPE(ClassTree.class), |
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
577 |
|
d3d578d22cc7
6570730: com.sun.source.tree.ModifiersTree.getFlags() should return class type
jjg
parents:
5848
diff
changeset
|
578 |
/** |
10 | 579 |
* An implementation-reserved node. This is the not the node |
580 |
* you are looking for. |
|
581 |
*/ |
|
582 |
OTHER(null); |
|
583 |
||
584 |
||
585 |
Kind(Class<? extends Tree> intf) { |
|
586 |
associatedInterface = intf; |
|
587 |
} |
|
588 |
||
589 |
public Class<? extends Tree> asInterface() { |
|
590 |
return associatedInterface; |
|
591 |
} |
|
592 |
||
593 |
private final Class<? extends Tree> associatedInterface; |
|
594 |
} |
|
595 |
||
596 |
/** |
|
597 |
* Gets the kind of this tree. |
|
598 |
* |
|
599 |
* @return the kind of this tree. |
|
600 |
*/ |
|
601 |
Kind getKind(); |
|
602 |
||
603 |
/** |
|
604 |
* Accept method used to implement the visitor pattern. The |
|
605 |
* visitor pattern is used to implement operations on trees. |
|
606 |
* |
|
607 |
* @param <R> result type of this operation. |
|
608 |
* @param <D> type of additonal data. |
|
609 |
*/ |
|
610 |
<R,D> R accept(TreeVisitor<R,D> visitor, D data); |
|
611 |
} |