1 /*
2 * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
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 *
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.
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 *
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 *
39 * @author Peter von der Ahé
40 * @since 1.6
41 */
42 public class SimpleTreeVisitor <R,P> implements TreeVisitor<R,P> {
43 /**
44 * The default value, returned by the {@link #defaultAction default action}.
45 */
46 protected final R DEFAULT_VALUE;
47
48 /**
49 * Creates a visitor, with a DEFAULT_VALUE of {@code null}.
50 */
51 protected SimpleTreeVisitor() {
52 DEFAULT_VALUE = null;
53 }
54
55 /**
56 * Creates a visitor, with a specified DEFAULT_VALUE.
57 * @param defaultValue the default value to be returned by the default action
58 */
59 protected SimpleTreeVisitor(R defaultValue) {
60 DEFAULT_VALUE = defaultValue;
61 }
62
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 */
69 protected R defaultAction(Tree node, P p) {
70 return DEFAULT_VALUE;
71 }
72
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 */
79 public final R visit(Tree node, P p) {
80 return (node == null) ? null : node.accept(this, p);
81 }
82
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 */
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
98 /**
99 * {@inheritDoc}
100 *
101 * @implSpec This implementation calls {@code defaultAction}.
102 *
103 * @param node {@inheritDoc}
104 * @param p {@inheritDoc}
105 * @return the result of {@code defaultAction}
106 */
107 @Override
108 public R visitCompilationUnit(CompilationUnitTree node, P p) {
109 return defaultAction(node, p);
110 }
111
112 /**
113 * {@inheritDoc}
114 *
115 * @implSpec This implementation calls {@code defaultAction}.
116 *
117 * @param node {@inheritDoc}
118 * @param p {@inheritDoc}
119 * @return the result of {@code defaultAction}
120 */
121 @Override
122 public R visitPackage(PackageTree node, P p) {
123 return defaultAction(node, p);
124 }
125
126 /**
127 * {@inheritDoc}
128 *
129 * @implSpec This implementation calls {@code defaultAction}.
130 *
131 * @param node {@inheritDoc}
132 * @param p {@inheritDoc}
133 * @return the result of {@code defaultAction}
134 */
135 @Override
136 public R visitImport(ImportTree node, P p) {
137 return defaultAction(node, p);
138 }
139
140 /**
141 * {@inheritDoc}
142 *
143 * @implSpec This implementation calls {@code defaultAction}.
144 *
145 * @param node {@inheritDoc}
146 * @param p {@inheritDoc}
147 * @return the result of {@code defaultAction}
148 */
149 @Override
150 public R visitClass(ClassTree node, P p) {
151 return defaultAction(node, p);
152 }
153
154 /**
155 * {@inheritDoc}
156 *
157 * @implSpec This implementation calls {@code defaultAction}.
158 *
159 * @param node {@inheritDoc}
160 * @param p {@inheritDoc}
161 * @return the result of {@code defaultAction}
162 */
163 @Override
164 public R visitMethod(MethodTree node, P p) {
165 return defaultAction(node, p);
166 }
167
168 /**
169 * {@inheritDoc}
170 *
171 * @implSpec This implementation calls {@code defaultAction}.
172 *
173 * @param node {@inheritDoc}
174 * @param p {@inheritDoc}
175 * @return the result of {@code defaultAction}
176 */
177 @Override
178 public R visitVariable(VariableTree node, P p) {
179 return defaultAction(node, p);
180 }
181
182 /**
183 * {@inheritDoc}
184 *
185 * @implSpec This implementation calls {@code defaultAction}.
186 *
187 * @param node {@inheritDoc}
188 * @param p {@inheritDoc}
189 * @return the result of {@code defaultAction}
190 */
191 @Override
192 public R visitEmptyStatement(EmptyStatementTree node, P p) {
193 return defaultAction(node, p);
194 }
195
196 /**
197 * {@inheritDoc}
198 *
199 * @implSpec This implementation calls {@code defaultAction}.
200 *
201 * @param node {@inheritDoc}
202 * @param p {@inheritDoc}
203 * @return the result of {@code defaultAction}
204 */
205 @Override
206 public R visitBlock(BlockTree node, P p) {
207 return defaultAction(node, p);
208 }
209
210 /**
211 * {@inheritDoc}
212 *
213 * @implSpec This implementation calls {@code defaultAction}.
214 *
215 * @param node {@inheritDoc}
216 * @param p {@inheritDoc}
217 * @return the result of {@code defaultAction}
218 */
219 @Override
220 public R visitDoWhileLoop(DoWhileLoopTree node, P p) {
221 return defaultAction(node, p);
222 }
223
224 /**
225 * {@inheritDoc}
226 *
227 * @implSpec This implementation calls {@code defaultAction}.
228 *
229 * @param node {@inheritDoc}
230 * @param p {@inheritDoc}
231 * @return the result of {@code defaultAction}
232 */
233 @Override
234 public R visitWhileLoop(WhileLoopTree node, P p) {
235 return defaultAction(node, p);
236 }
237
238 /**
239 * {@inheritDoc}
240 *
241 * @implSpec This implementation calls {@code defaultAction}.
242 *
243 * @param node {@inheritDoc}
244 * @param p {@inheritDoc}
245 * @return the result of {@code defaultAction}
246 */
247 @Override
248 public R visitForLoop(ForLoopTree node, P p) {
249 return defaultAction(node, p);
250 }
251
252 /**
253 * {@inheritDoc}
254 *
255 * @implSpec This implementation calls {@code defaultAction}.
256 *
257 * @param node {@inheritDoc}
258 * @param p {@inheritDoc}
259 * @return the result of {@code defaultAction}
260 */
261 @Override
262 public R visitEnhancedForLoop(EnhancedForLoopTree node, P p) {
263 return defaultAction(node, p);
264 }
265
266 /**
267 * {@inheritDoc}
268 *
269 * @implSpec This implementation calls {@code defaultAction}.
270 *
271 * @param node {@inheritDoc}
272 * @param p {@inheritDoc}
273 * @return the result of {@code defaultAction}
274 */
275 @Override
276 public R visitLabeledStatement(LabeledStatementTree node, P p) {
277 return defaultAction(node, p);
278 }
279
280 /**
281 * {@inheritDoc}
282 *
283 * @implSpec This implementation calls {@code defaultAction}.
284 *
285 * @param node {@inheritDoc}
286 * @param p {@inheritDoc}
287 * @return the result of {@code defaultAction}
288 */
289 @Override
290 public R visitSwitch(SwitchTree node, P p) {
291 return defaultAction(node, p);
292 }
293
294 /**
295 * {@inheritDoc}
296 *
297 * @implSpec This implementation calls {@code defaultAction}.
298 *
299 * @param node {@inheritDoc}
300 * @param p {@inheritDoc}
301 * @return the result of {@code defaultAction}
302 *
303 * @since 14
304 */
305 @Override
306 public R visitSwitchExpression(SwitchExpressionTree node, P p) {
307 return defaultAction(node, p);
308 }
309
310 /**
311 * {@inheritDoc}
312 *
313 * @implSpec This implementation calls {@code defaultAction}.
314 *
315 * @param node {@inheritDoc}
316 * @param p {@inheritDoc}
317 * @return the result of {@code defaultAction}
318 */
319 @Override
320 public R visitCase(CaseTree node, P p) {
321 return defaultAction(node, p);
322 }
323
324 /**
325 * {@inheritDoc}
326 *
327 * @implSpec This implementation calls {@code defaultAction}.
328 *
329 * @param node {@inheritDoc}
330 * @param p {@inheritDoc}
331 * @return the result of {@code defaultAction}
332 */
333 @Override
334 public R visitSynchronized(SynchronizedTree node, P p) {
335 return defaultAction(node, p);
336 }
337
338 /**
339 * {@inheritDoc}
340 *
341 * @implSpec This implementation calls {@code defaultAction}.
342 *
343 * @param node {@inheritDoc}
344 * @param p {@inheritDoc}
345 * @return the result of {@code defaultAction}
346 */
347 @Override
348 public R visitTry(TryTree node, P p) {
349 return defaultAction(node, p);
350 }
351
352 /**
353 * {@inheritDoc}
354 *
355 * @implSpec This implementation calls {@code defaultAction}.
356 *
357 * @param node {@inheritDoc}
358 * @param p {@inheritDoc}
359 * @return the result of {@code defaultAction}
360 */
361 @Override
362 public R visitCatch(CatchTree node, P p) {
363 return defaultAction(node, p);
364 }
365
366 /**
367 * {@inheritDoc}
368 *
369 * @implSpec This implementation calls {@code defaultAction}.
370 *
371 * @param node {@inheritDoc}
372 * @param p {@inheritDoc}
373 * @return the result of {@code defaultAction}
374 */
375 @Override
376 public R visitConditionalExpression(ConditionalExpressionTree node, P p) {
377 return defaultAction(node, p);
378 }
379
380 /**
381 * {@inheritDoc}
382 *
383 * @implSpec This implementation calls {@code defaultAction}.
384 *
385 * @param node {@inheritDoc}
386 * @param p {@inheritDoc}
387 * @return the result of {@code defaultAction}
388 */
389 @Override
390 public R visitIf(IfTree node, P p) {
391 return defaultAction(node, p);
392 }
393
394 /**
395 * {@inheritDoc}
396 *
397 * @implSpec This implementation calls {@code defaultAction}.
398 *
399 * @param node {@inheritDoc}
400 * @param p {@inheritDoc}
401 * @return the result of {@code defaultAction}
402 */
403 @Override
404 public R visitExpressionStatement(ExpressionStatementTree node, P p) {
405 return defaultAction(node, p);
406 }
407
408 /**
409 * {@inheritDoc}
410 *
411 * @implSpec This implementation calls {@code defaultAction}.
412 *
413 * @param node {@inheritDoc}
414 * @param p {@inheritDoc}
415 * @return the result of {@code defaultAction}
416 */
417 @Override
418 public R visitBreak(BreakTree node, P p) {
419 return defaultAction(node, p);
420 }
421
422 /**
423 * {@inheritDoc}
424 *
425 * @implSpec This implementation calls {@code defaultAction}.
426 *
427 * @param node {@inheritDoc}
428 * @param p {@inheritDoc}
429 * @return the result of {@code defaultAction}
430 */
431 @Override
432 public R visitContinue(ContinueTree node, P p) {
433 return defaultAction(node, p);
434 }
435
436 /**
437 * {@inheritDoc}
438 *
439 * @implSpec This implementation calls {@code defaultAction}.
440 *
441 * @param node {@inheritDoc}
442 * @param p {@inheritDoc}
443 * @return the result of {@code defaultAction}
444 */
445 @Override
446 public R visitReturn(ReturnTree node, P p) {
447 return defaultAction(node, p);
448 }
449
450 /**
451 * {@inheritDoc}
452 *
453 * @implSpec This implementation calls {@code defaultAction}.
454 *
455 * @param node {@inheritDoc}
456 * @param p {@inheritDoc}
457 * @return the result of {@code defaultAction}
458 */
459 @Override
460 public R visitThrow(ThrowTree node, P p) {
461 return defaultAction(node, p);
462 }
463
464 /**
465 * {@inheritDoc}
466 *
467 * @implSpec This implementation calls {@code defaultAction}.
468 *
469 * @param node {@inheritDoc}
470 * @param p {@inheritDoc}
471 * @return the result of {@code defaultAction}
472 */
473 @Override
474 public R visitAssert(AssertTree node, P p) {
475 return defaultAction(node, p);
476 }
477
478 /**
479 * {@inheritDoc}
480 *
481 * @implSpec This implementation calls {@code defaultAction}.
482 *
483 * @param node {@inheritDoc}
484 * @param p {@inheritDoc}
485 * @return the result of {@code defaultAction}
486 */
487 @Override
488 public R visitMethodInvocation(MethodInvocationTree node, P p) {
489 return defaultAction(node, p);
490 }
491
492 /**
493 * {@inheritDoc}
494 *
495 * @implSpec This implementation calls {@code defaultAction}.
496 *
497 * @param node {@inheritDoc}
498 * @param p {@inheritDoc}
499 * @return the result of {@code defaultAction}
500 */
501 @Override
502 public R visitNewClass(NewClassTree node, P p) {
503 return defaultAction(node, p);
504 }
505
506 /**
507 * {@inheritDoc}
508 *
509 * @implSpec This implementation calls {@code defaultAction}.
510 *
511 * @param node {@inheritDoc}
512 * @param p {@inheritDoc}
513 * @return the result of {@code defaultAction}
514 */
515 @Override
516 public R visitNewArray(NewArrayTree node, P p) {
517 return defaultAction(node, p);
518 }
519
520 /**
521 * {@inheritDoc}
522 *
523 * @implSpec This implementation calls {@code defaultAction}.
524 *
525 * @param node {@inheritDoc}
526 * @param p {@inheritDoc}
527 * @return the result of {@code defaultAction}
528 */
529 @Override
530 public R visitLambdaExpression(LambdaExpressionTree node, P p) {
531 return defaultAction(node, p);
532 }
533
534 /**
535 * {@inheritDoc}
536 *
537 * @implSpec This implementation calls {@code defaultAction}.
538 *
539 * @param node {@inheritDoc}
540 * @param p {@inheritDoc}
541 * @return the result of {@code defaultAction}
542 */
543 @Override
544 public R visitParenthesized(ParenthesizedTree node, P p) {
545 return defaultAction(node, p);
546 }
547
548 /**
549 * {@inheritDoc}
550 *
551 * @implSpec This implementation calls {@code defaultAction}.
552 *
553 * @param node {@inheritDoc}
554 * @param p {@inheritDoc}
555 * @return the result of {@code defaultAction}
556 */
557 @Override
558 public R visitAssignment(AssignmentTree node, P p) {
559 return defaultAction(node, p);
560 }
561
562 /**
563 * {@inheritDoc}
564 *
565 * @implSpec This implementation calls {@code defaultAction}.
566 *
567 * @param node {@inheritDoc}
568 * @param p {@inheritDoc}
569 * @return the result of {@code defaultAction}
570 */
571 @Override
572 public R visitCompoundAssignment(CompoundAssignmentTree node, P p) {
573 return defaultAction(node, p);
574 }
575
576 /**
577 * {@inheritDoc}
578 *
579 * @implSpec This implementation calls {@code defaultAction}.
580 *
581 * @param node {@inheritDoc}
582 * @param p {@inheritDoc}
583 * @return the result of {@code defaultAction}
584 */
585 @Override
586 public R visitUnary(UnaryTree node, P p) {
587 return defaultAction(node, p);
588 }
589
590 /**
591 * {@inheritDoc}
592 *
593 * @implSpec This implementation calls {@code defaultAction}.
594 *
595 * @param node {@inheritDoc}
596 * @param p {@inheritDoc}
597 * @return the result of {@code defaultAction}
598 */
599 @Override
600 public R visitBinary(BinaryTree node, P p) {
601 return defaultAction(node, p);
602 }
603
604 /**
605 * {@inheritDoc}
606 *
607 * @implSpec This implementation calls {@code defaultAction}.
608 *
609 * @param node {@inheritDoc}
610 * @param p {@inheritDoc}
611 * @return the result of {@code defaultAction}
612 */
613 @Override
614 public R visitTypeCast(TypeCastTree node, P p) {
615 return defaultAction(node, p);
616 }
617
618 /**
619 * {@inheritDoc}
620 *
621 * @implSpec This implementation calls {@code defaultAction}.
622 *
623 * @param node {@inheritDoc}
624 * @param p {@inheritDoc}
625 * @return the result of {@code defaultAction}
626 */
627 @Override
628 public R visitInstanceOf(InstanceOfTree node, P p) {
629 return defaultAction(node, p);
630 }
631
632 /**
633 * {@inheritDoc}
634 *
635 * @implSpec This implementation calls {@code defaultAction}.
636 *
637 * @param node {@inheritDoc}
638 * @param p {@inheritDoc}
639 * @return the result of {@code defaultAction}
640 * @since 22
641 */
642 @Override
643 public R visitAnyPattern(AnyPatternTree node, P p) {
644 return defaultAction(node, p);
645 }
646
647 /**
648 * {@inheritDoc}
649 *
650 * @implSpec This implementation calls {@code defaultAction}.
651 *
652 * @param node {@inheritDoc}
653 * @param p {@inheritDoc}
654 * @return the result of {@code defaultAction}
655 * @since 14
656 */
657 @Override
658 public R visitBindingPattern(BindingPatternTree node, P p) {
659 return defaultAction(node, p);
660 }
661
662 /**
663 * {@inheritDoc}
664 *
665 * @implSpec This implementation calls {@code defaultAction}.
666 *
667 * @param node {@inheritDoc}
668 * @param p {@inheritDoc}
669 * @return the result of {@code defaultAction}
670 * @since 21
671 */
672 @Override
673 public R visitDefaultCaseLabel(DefaultCaseLabelTree node, P p) {
674 return defaultAction(node, p);
675 }
676
677 /**
678 * {@inheritDoc}
679 *
680 * @implSpec This implementation calls {@code defaultAction}.
681 *
682 * @param node {@inheritDoc}
683 * @param p {@inheritDoc}
684 * @return the result of {@code defaultAction}
685 * @since 21
686 */
687 @Override
688 public R visitConstantCaseLabel(ConstantCaseLabelTree node, P p) {
689 return defaultAction(node, p);
690 }
691
692 /**
693 * {@inheritDoc}
694 *
695 * @implSpec This implementation calls {@code defaultAction}.
696 *
697 * @param node {@inheritDoc}
698 * @param p {@inheritDoc}
699 * @return the result of {@code defaultAction}
700 * @since 21
701 */
702 @Override
703 public R visitDeconstructionPattern(DeconstructionPatternTree node, P p) {
704 return defaultAction(node, p);
705 }
706
707 /**
708 * {@inheritDoc}
709 *
710 * @implSpec This implementation calls {@code defaultAction}.
711 *
712 * @param node {@inheritDoc}
713 * @param p {@inheritDoc}
714 * @return the result of {@code defaultAction}
715 * @since 21
716 */
717 @Override
718 public R visitPatternCaseLabel(PatternCaseLabelTree node, P p) {
719 return defaultAction(node, p);
720 }
721
722 /**
723 * {@inheritDoc}
724 *
725 * @implSpec This implementation calls {@code defaultAction}.
726 *
727 * @param node {@inheritDoc}
728 * @param p {@inheritDoc}
729 * @return the result of {@code defaultAction}
730 */
731 @Override
732 public R visitArrayAccess(ArrayAccessTree node, P p) {
733 return defaultAction(node, p);
734 }
735
736 /**
737 * {@inheritDoc}
738 *
739 * @implSpec This implementation calls {@code defaultAction}.
740 *
741 * @param node {@inheritDoc}
742 * @param p {@inheritDoc}
743 * @return the result of {@code defaultAction}
744 */
745 @Override
746 public R visitMemberSelect(MemberSelectTree node, P p) {
747 return defaultAction(node, p);
748 }
749
750 /**
751 * {@inheritDoc}
752 *
753 * @implSpec This implementation calls {@code defaultAction}.
754 *
755 * @param node {@inheritDoc}
756 * @param p {@inheritDoc}
757 * @return the result of {@code defaultAction}
758 */
759 @Override
760 public R visitMemberReference(MemberReferenceTree node, P p) {
761 return defaultAction(node, p);
762 }
763
764 /**
765 * {@inheritDoc}
766 *
767 * @implSpec This implementation calls {@code defaultAction}.
768 *
769 * @param node {@inheritDoc}
770 * @param p {@inheritDoc}
771 * @return the result of {@code defaultAction}
772 */
773 @Override
774 public R visitIdentifier(IdentifierTree node, P p) {
775 return defaultAction(node, p);
776 }
777
778 /**
779 * {@inheritDoc}
780 *
781 * @implSpec This implementation calls {@code defaultAction}.
782 *
783 * @param node {@inheritDoc}
784 * @param p {@inheritDoc}
785 * @return the result of {@code defaultAction}
786 */
787 @Override
788 public R visitLiteral(LiteralTree node, P p) {
789 return defaultAction(node, p);
790 }
791
792 /**
793 * {@inheritDoc}
794 *
795 * @implSpec This implementation calls {@code defaultAction}.
796 *
797 * @param node {@inheritDoc}
798 * @param p {@inheritDoc}
799 * @return the result of {@code defaultAction}
800 */
801 @Override
802 public R visitPrimitiveType(PrimitiveTypeTree node, P p) {
803 return defaultAction(node, p);
804 }
805
806 /**
807 * {@inheritDoc}
808 *
809 * @implSpec This implementation calls {@code defaultAction}.
810 *
811 * @param node {@inheritDoc}
812 * @param p {@inheritDoc}
813 * @return the result of {@code defaultAction}
814 * @since 27
815 */
816 @Override
817 public R visitVarType(VarTypeTree node, P p) {
818 return defaultAction(node, p);
819 }
820
821 /**
822 * {@inheritDoc}
823 *
824 * @implSpec This implementation calls {@code defaultAction}.
825 *
826 * @param node {@inheritDoc}
827 * @param p {@inheritDoc}
828 * @return the result of {@code defaultAction}
829 */
830 @Override
831 public R visitArrayType(ArrayTypeTree node, P p) {
832 return defaultAction(node, p);
833 }
834
835 /**
836 * {@inheritDoc}
837 *
838 * @implSpec This implementation calls {@code defaultAction}.
839 *
840 * @param node {@inheritDoc}
841 * @param p {@inheritDoc}
842 * @return the result of {@code defaultAction}
843 */
844 @Override
845 public R visitParameterizedType(ParameterizedTypeTree node, P p) {
846 return defaultAction(node, p);
847 }
848
849 /**
850 * {@inheritDoc}
851 *
852 * @implSpec This implementation calls {@code defaultAction}.
853 *
854 * @param node {@inheritDoc}
855 * @param p {@inheritDoc}
856 * @return the result of {@code defaultAction}
857 */
858 @Override
859 public R visitUnionType(UnionTypeTree node, P p) {
860 return defaultAction(node, p);
861 }
862
863 /**
864 * {@inheritDoc}
865 *
866 * @implSpec This implementation calls {@code defaultAction}.
867 *
868 * @param node {@inheritDoc}
869 * @param p {@inheritDoc}
870 * @return the result of {@code defaultAction}
871 */
872 @Override
873 public R visitIntersectionType(IntersectionTypeTree node, P p) {
874 return defaultAction(node, p);
875 }
876
877 /**
878 * {@inheritDoc}
879 *
880 * @implSpec This implementation calls {@code defaultAction}.
881 *
882 * @param node {@inheritDoc}
883 * @param p {@inheritDoc}
884 * @return the result of {@code defaultAction}
885 */
886 @Override
887 public R visitTypeParameter(TypeParameterTree node, P p) {
888 return defaultAction(node, p);
889 }
890
891 /**
892 * {@inheritDoc}
893 *
894 * @implSpec This implementation calls {@code defaultAction}.
895 *
896 * @param node {@inheritDoc}
897 * @param p {@inheritDoc}
898 * @return the result of {@code defaultAction}
899 */
900 @Override
901 public R visitWildcard(WildcardTree node, P p) {
902 return defaultAction(node, p);
903 }
904
905 /**
906 * {@inheritDoc}
907 *
908 * @implSpec This implementation calls {@code defaultAction}.
909 *
910 * @param node {@inheritDoc}
911 * @param p {@inheritDoc}
912 * @return the result of {@code defaultAction}
913 */
914 @Override
915 public R visitModifiers(ModifiersTree node, P p) {
916 return defaultAction(node, p);
917 }
918
919 /**
920 * {@inheritDoc}
921 *
922 * @implSpec This implementation calls {@code defaultAction}.
923 *
924 * @param node {@inheritDoc}
925 * @param p {@inheritDoc}
926 * @return the result of {@code defaultAction}
927 */
928 @Override
929 public R visitAnnotation(AnnotationTree node, P p) {
930 return defaultAction(node, p);
931 }
932
933 /**
934 * {@inheritDoc}
935 *
936 * @implSpec This implementation calls {@code defaultAction}.
937 *
938 * @param node {@inheritDoc}
939 * @param p {@inheritDoc}
940 * @return the result of {@code defaultAction}
941 */
942 @Override
943 public R visitAnnotatedType(AnnotatedTypeTree node, P p) {
944 return defaultAction(node, p);
945 }
946
947 /**
948 * {@inheritDoc}
949 *
950 * @implSpec This implementation calls {@code defaultAction}.
951 *
952 * @param node {@inheritDoc}
953 * @param p {@inheritDoc}
954 * @return the result of {@code defaultAction}
955 */
956 @Override
957 public R visitModule(ModuleTree node, P p) {
958 return defaultAction(node, p);
959 }
960
961 /**
962 * {@inheritDoc}
963 *
964 * @implSpec This implementation calls {@code defaultAction}.
965 *
966 * @param node {@inheritDoc}
967 * @param p {@inheritDoc}
968 * @return the result of {@code defaultAction}
969 */
970 @Override
971 public R visitExports(ExportsTree node, P p) {
972 return defaultAction(node, p);
973 }
974
975 /**
976 * {@inheritDoc}
977 *
978 * @implSpec This implementation calls {@code defaultAction}.
979 *
980 * @param node {@inheritDoc}
981 * @param p {@inheritDoc}
982 * @return the result of {@code defaultAction}
983 */
984 @Override
985 public R visitOpens(OpensTree node, P p) {
986 return defaultAction(node, p);
987 }
988
989 /**
990 * {@inheritDoc}
991 *
992 * @implSpec This implementation calls {@code defaultAction}.
993 *
994 * @param node {@inheritDoc}
995 * @param p {@inheritDoc}
996 * @return the result of {@code defaultAction}
997 */
998 @Override
999 public R visitProvides(ProvidesTree node, P p) {
1000 return defaultAction(node, p);
1001 }
1002
1003 /**
1004 * {@inheritDoc}
1005 *
1006 * @implSpec This implementation calls {@code defaultAction}.
1007 *
1008 * @param node {@inheritDoc}
1009 * @param p {@inheritDoc}
1010 * @return the result of {@code defaultAction}
1011 */
1012 @Override
1013 public R visitRequires(RequiresTree node, P p) {
1014 return defaultAction(node, p);
1015 }
1016
1017 /**
1018 * {@inheritDoc}
1019 *
1020 * @implSpec This implementation calls {@code defaultAction}.
1021 *
1022 * @param node {@inheritDoc}
1023 * @param p {@inheritDoc}
1024 * @return the result of {@code defaultAction}
1025 */
1026 @Override
1027 public R visitUses(UsesTree node, P p) {
1028 return defaultAction(node, p);
1029 }
1030
1031 /**
1032 * {@inheritDoc}
1033 *
1034 * @implSpec This implementation calls {@code defaultAction}.
1035 *
1036 * @param node {@inheritDoc}
1037 * @param p {@inheritDoc}
1038 * @return the result of {@code defaultAction}
1039 */
1040 @Override
1041 public R visitErroneous(ErroneousTree node, P p) {
1042 return defaultAction(node, p);
1043 }
1044
1045 /**
1046 * {@inheritDoc}
1047 *
1048 * @implSpec This implementation calls {@code defaultAction}.
1049 *
1050 * @param node {@inheritDoc}
1051 * @param p {@inheritDoc}
1052 * @return the result of {@code defaultAction}
1053 */
1054 @Override
1055 public R visitOther(Tree node, P p) {
1056 return defaultAction(node, p);
1057 }
1058
1059 /**
1060 * {@inheritDoc}
1061 *
1062 * @implSpec This implementation calls {@code defaultAction}.
1063 *
1064 * @param node {@inheritDoc}
1065 * @param p {@inheritDoc}
1066 * @return the result of {@code defaultAction}
1067 *
1068 * @since 14
1069 */
1070 @Override
1071 public R visitYield(YieldTree node, P p) {
1072 return defaultAction(node, p);
1073 }
1074 }