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