1 /* |
1 /* |
2 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2010, 2011 Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
32 import javax.lang.model.SourceVersion; |
32 import javax.lang.model.SourceVersion; |
33 |
33 |
34 /** |
34 /** |
35 * A visitor of program elements based on their {@linkplain |
35 * A visitor of program elements based on their {@linkplain |
36 * ElementKind kind} with default behavior appropriate for the {@link |
36 * ElementKind kind} with default behavior appropriate for the {@link |
37 * SourceVersion#RELEASE_6 RELEASE_6} source version. For {@linkplain |
37 * SourceVersion#RELEASE_7 RELEASE_7} source version. For {@linkplain |
38 * Element elements} <tt><i>XYZ</i></tt> that may have more than one |
38 * Element elements} <tt><i>XYZ</i></tt> that may have more than one |
39 * kind, the <tt>visit<i>XYZ</i></tt> methods in this class delegate |
39 * kind, the <tt>visit<i>XYZ</i></tt> methods in this class delegate |
40 * to the <tt>visit<i>XYZKind</i></tt> method corresponding to the |
40 * to the <tt>visit<i>XYZKind</i></tt> method corresponding to the |
41 * first argument's kind. The <tt>visit<i>XYZKind</i></tt> methods |
41 * first argument's kind. The <tt>visit<i>XYZKind</i></tt> methods |
42 * call {@link #defaultAction defaultAction}, passing their arguments |
42 * call {@link #defaultAction defaultAction}, passing their arguments |
92 * @param defaultValue the value to assign to {@link #DEFAULT_VALUE} |
92 * @param defaultValue the value to assign to {@link #DEFAULT_VALUE} |
93 */ |
93 */ |
94 protected ElementKindVisitor7(R defaultValue) { |
94 protected ElementKindVisitor7(R defaultValue) { |
95 super(defaultValue); |
95 super(defaultValue); |
96 } |
96 } |
|
97 |
|
98 /** |
|
99 * Visits a {@code RESOURCE_VARIABLE} variable element by calling |
|
100 * {@code defaultAction}. |
|
101 * |
|
102 * @param e {@inheritDoc} |
|
103 * @param p {@inheritDoc} |
|
104 * @return the result of {@code defaultAction} |
|
105 */ |
|
106 @Override |
|
107 public R visitVariableAsResourceVariable(VariableElement e, P p) { |
|
108 return defaultAction(e, p); |
|
109 } |
97 } |
110 } |