48 * classes which extend this class should not declare any instance 49 * methods with names beginning with {@code "visit"}. 50 * 51 * <p>When such a new visit method is added, the default 52 * implementation in this class will be to call the {@link 53 * #visitUnknown visitUnknown} method. A new abstract element visitor 54 * class will also be introduced to correspond to the new language 55 * level; this visitor will have different default behavior for the 56 * visit method in question. When the new visitor is introduced, all 57 * or portions of this visitor may be deprecated. 58 * 59 * @param <R> the return type of this visitor's methods. Use {@link 60 * Void} for visitors that do not need to return results. 61 * @param <P> the type of the additional parameter to this visitor's 62 * methods. Use {@code Void} for visitors that do not need an 63 * additional parameter. 64 * 65 * @author Joseph D. Darcy 66 * @author Scott Seligman 67 * @author Peter von der Ahé 68 * @since 1.6 69 */ 70 @SupportedSourceVersion(RELEASE_6) 71 public abstract class AbstractElementVisitor6<R, P> implements ElementVisitor<R, P> { 72 /** 73 * Constructor for concrete subclasses to call. 74 */ 75 protected AbstractElementVisitor6(){} 76 77 /** 78 * Visits any program element as if by passing itself to that 79 * element's {@link Element#accept accept} method. The invocation 80 * {@code v.visit(elem)} is equivalent to {@code elem.accept(v, 81 * p)}. 82 * 83 * @param e the element to visit 84 * @param p a visitor-specified parameter 85 * @return a visitor-specified result 86 */ 87 public final R visit(Element e, P p) { | 48 * classes which extend this class should not declare any instance 49 * methods with names beginning with {@code "visit"}. 50 * 51 * <p>When such a new visit method is added, the default 52 * implementation in this class will be to call the {@link 53 * #visitUnknown visitUnknown} method. A new abstract element visitor 54 * class will also be introduced to correspond to the new language 55 * level; this visitor will have different default behavior for the 56 * visit method in question. When the new visitor is introduced, all 57 * or portions of this visitor may be deprecated. 58 * 59 * @param <R> the return type of this visitor's methods. Use {@link 60 * Void} for visitors that do not need to return results. 61 * @param <P> the type of the additional parameter to this visitor's 62 * methods. Use {@code Void} for visitors that do not need an 63 * additional parameter. 64 * 65 * @author Joseph D. Darcy 66 * @author Scott Seligman 67 * @author Peter von der Ahé 68 * 69 * @see AbstractElementVisitor7 70 * @since 1.6 71 */ 72 @SupportedSourceVersion(RELEASE_6) 73 public abstract class AbstractElementVisitor6<R, P> implements ElementVisitor<R, P> { 74 /** 75 * Constructor for concrete subclasses to call. 76 */ 77 protected AbstractElementVisitor6(){} 78 79 /** 80 * Visits any program element as if by passing itself to that 81 * element's {@link Element#accept accept} method. The invocation 82 * {@code v.visit(elem)} is equivalent to {@code elem.accept(v, 83 * p)}. 84 * 85 * @param e the element to visit 86 * @param p a visitor-specified parameter 87 * @return a visitor-specified result 88 */ 89 public final R visit(Element e, P p) { |