1 /* |
1 /* |
2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2005, 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 |
150 } |
150 } |
151 |
151 |
152 /** |
152 /** |
153 * {@inheritDoc} This implementation scans the enclosed elements. |
153 * {@inheritDoc} This implementation scans the enclosed elements. |
154 * |
154 * |
155 * @param e the element to visit |
155 * @param e {@inheritDoc} |
156 * @param p a visitor-specified parameter |
156 * @param p {@inheritDoc} |
157 * @return the result of scanning |
157 * @return the result of scanning |
158 */ |
158 */ |
159 public R visitPackage(PackageElement e, P p) { |
159 public R visitPackage(PackageElement e, P p) { |
160 return scan(e.getEnclosedElements(), p); |
160 return scan(e.getEnclosedElements(), p); |
161 } |
161 } |
162 |
162 |
163 /** |
163 /** |
164 * {@inheritDoc} This implementation scans the enclosed elements. |
164 * {@inheritDoc} This implementation scans the enclosed elements. |
165 * |
165 * |
166 * @param e the element to visit |
166 * @param e {@inheritDoc} |
167 * @param p a visitor-specified parameter |
167 * @param p {@inheritDoc} |
168 * @return the result of scanning |
168 * @return the result of scanning |
169 */ |
169 */ |
170 public R visitType(TypeElement e, P p) { |
170 public R visitType(TypeElement e, P p) { |
171 return scan(e.getEnclosedElements(), p); |
171 return scan(e.getEnclosedElements(), p); |
172 } |
172 } |
173 |
173 |
174 /** |
174 /** |
175 * {@inheritDoc} This implementation scans the enclosed elements. |
175 * {@inheritDoc} |
176 * |
176 * |
177 * @param e the element to visit |
177 * This implementation scans the enclosed elements, unless the |
178 * @param p a visitor-specified parameter |
178 * element is a {@code RESOURCE_VARIABLE} in which case {@code |
|
179 * visitUnknown} is called. |
|
180 * |
|
181 * @param e {@inheritDoc} |
|
182 * @param p {@inheritDoc} |
179 * @return the result of scanning |
183 * @return the result of scanning |
180 */ |
184 */ |
181 public R visitVariable(VariableElement e, P p) { |
185 public R visitVariable(VariableElement e, P p) { |
182 return scan(e.getEnclosedElements(), p); |
186 if (e.getKind() != ElementKind.RESOURCE_VARIABLE) |
|
187 return scan(e.getEnclosedElements(), p); |
|
188 else |
|
189 return visitUnknown(e, p); |
183 } |
190 } |
184 |
191 |
185 /** |
192 /** |
186 * {@inheritDoc} This implementation scans the parameters. |
193 * {@inheritDoc} This implementation scans the parameters. |
187 * |
194 * |
188 * @param e the element to visit |
195 * @param e {@inheritDoc} |
189 * @param p a visitor-specified parameter |
196 * @param p {@inheritDoc} |
190 * @return the result of scanning |
197 * @return the result of scanning |
191 */ |
198 */ |
192 public R visitExecutable(ExecutableElement e, P p) { |
199 public R visitExecutable(ExecutableElement e, P p) { |
193 return scan(e.getParameters(), p); |
200 return scan(e.getParameters(), p); |
194 } |
201 } |
195 |
202 |
196 /** |
203 /** |
197 * {@inheritDoc} This implementation scans the enclosed elements. |
204 * {@inheritDoc} This implementation scans the enclosed elements. |
198 * |
205 * |
199 * @param e the element to visit |
206 * @param e {@inheritDoc} |
200 * @param p a visitor-specified parameter |
207 * @param p {@inheritDoc} |
201 * @return the result of scanning |
208 * @return the result of scanning |
202 */ |
209 */ |
203 public R visitTypeParameter(TypeParameterElement e, P p) { |
210 public R visitTypeParameter(TypeParameterElement e, P p) { |
204 return scan(e.getEnclosedElements(), p); |
211 return scan(e.getEnclosedElements(), p); |
205 } |
212 } |