0N/A/*
797N/A * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
553N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
553N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
553N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
553N/A * or visit www.oracle.com if you need additional information or have any
553N/A * questions.
0N/A */
0N/A
0N/Apackage javax.lang.model.util;
0N/A
0N/A
0N/Aimport java.util.List;
0N/Aimport javax.lang.model.element.*;
0N/A
0N/Aimport javax.lang.model.type.TypeMirror;
0N/Aimport static javax.lang.model.SourceVersion.*;
0N/Aimport javax.lang.model.SourceVersion;
0N/Aimport javax.annotation.processing.SupportedSourceVersion;
0N/A
0N/A/**
0N/A * A skeletal visitor for annotation values with default behavior
0N/A * appropriate for the {@link SourceVersion#RELEASE_6 RELEASE_6}
0N/A * source version.
0N/A *
0N/A * <p> <b>WARNING:</b> The {@code AnnotationValueVisitor} interface
0N/A * implemented by this class may have methods added to it in the
0N/A * future to accommodate new, currently unknown, language structures
0N/A * added to future versions of the Java&trade; programming language.
0N/A * Therefore, methods whose names begin with {@code "visit"} may be
0N/A * added to this class in the future; to avoid incompatibilities,
0N/A * classes which extend this class should not declare any instance
0N/A * methods with names beginning with {@code "visit"}.
0N/A *
0N/A * <p>When such a new visit method is added, the default
0N/A * implementation in this class will be to call the {@link
0N/A * #visitUnknown visitUnknown} method. A new abstract annotation
0N/A * value visitor class will also be introduced to correspond to the
0N/A * new language level; this visitor will have different default
0N/A * behavior for the visit method in question. When the new visitor is
0N/A * introduced, all or portions of this visitor may be deprecated.
0N/A *
0N/A * @param <R> the return type of this visitor's methods
0N/A * @param <P> the type of the additional parameter to this visitor's methods.
0N/A *
0N/A * @author Joseph D. Darcy
0N/A * @author Scott Seligman
0N/A * @author Peter von der Ah&eacute;
574N/A *
574N/A * @see AbstractAnnotationValueVisitor7
0N/A * @since 1.6
0N/A */
0N/A@SupportedSourceVersion(RELEASE_6)
0N/Apublic abstract class AbstractAnnotationValueVisitor6<R, P>
0N/A implements AnnotationValueVisitor<R, P> {
0N/A
0N/A /**
0N/A * Constructor for concrete subclasses to call.
0N/A */
0N/A protected AbstractAnnotationValueVisitor6() {}
0N/A
0N/A /**
0N/A * Visits an annotation value as if by passing itself to that
0N/A * value's {@link AnnotationValue#accept accept}. The invocation
0N/A * {@code v.visit(av)} is equivalent to {@code av.accept(v, p)}.
0N/A * @param av {@inheritDoc}
0N/A * @param p {@inheritDoc}
0N/A */
0N/A public final R visit(AnnotationValue av, P p) {
0N/A return av.accept(this, p);
0N/A }
0N/A
0N/A /**
0N/A * Visits an annotation value as if by passing itself to that
0N/A * value's {@link AnnotationValue#accept accept} method passing
0N/A * {@code null} for the additional parameter. The invocation
0N/A * {@code v.visit(av)} is equivalent to {@code av.accept(v,
0N/A * null)}.
0N/A * @param av {@inheritDoc}
0N/A */
0N/A public final R visit(AnnotationValue av) {
0N/A return av.accept(this, null);
0N/A }
0N/A
0N/A /**
0N/A * {@inheritDoc}
0N/A *
0N/A * <p>The default implementation of this method in {@code
0N/A * AbstractAnnotationValueVisitor6} will always throw {@code
0N/A * UnknownAnnotationValueException}. This behavior is not
0N/A * required of a subclass.
0N/A *
0N/A * @param av {@inheritDoc}
0N/A * @param p {@inheritDoc}
0N/A */
0N/A public R visitUnknown(AnnotationValue av, P p) {
0N/A throw new UnknownAnnotationValueException(av, p);
0N/A }
0N/A}