0N/A/*
553N/A * Copyright (c) 2005, 2009, 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.element;
0N/A
215N/Aimport javax.lang.model.UnknownEntityException;
215N/A
0N/A/**
0N/A * Indicates that an unknown kind of annotation value was encountered.
0N/A * This can occur if the language evolves and new kinds of annotation
0N/A * values can be stored in an annotation. May be thrown by an
0N/A * {@linkplain AnnotationValueVisitor annotation value visitor} to
0N/A * indicate that the visitor was created for a prior version of the
0N/A * language.
0N/A *
0N/A * @author Joseph D. Darcy
0N/A * @author Scott Seligman
0N/A * @author Peter von der Ahé
0N/A * @see AnnotationValueVisitor#visitUnknown
0N/A * @since 1.6
0N/A */
215N/Apublic class UnknownAnnotationValueException extends UnknownEntityException {
0N/A
0N/A private static final long serialVersionUID = 269L;
0N/A
0N/A private transient AnnotationValue av;
0N/A private transient Object parameter;
0N/A
0N/A /**
0N/A * Creates a new {@code UnknownAnnotationValueException}. The
0N/A * {@code p} parameter may be used to pass in an additional
0N/A * argument with information about the context in which the
0N/A * unknown annotation value was encountered; for example, the
0N/A * visit methods of {@link AnnotationValueVisitor} may pass in
0N/A * their additional parameter.
0N/A *
0N/A * @param av the unknown annotation value, may be {@code null}
0N/A * @param p an additional parameter, may be {@code null}
0N/A */
0N/A public UnknownAnnotationValueException(AnnotationValue av, Object p) {
0N/A super("Unknown annotation value: " + av);
0N/A this.av = av;
0N/A this.parameter = p;
0N/A }
0N/A
0N/A /**
0N/A * Returns the unknown annotation value.
0N/A * The value may be unavailable if this exception has been
0N/A * serialized and then read back in.
0N/A *
0N/A * @return the unknown element, or {@code null} if unavailable
0N/A */
0N/A public AnnotationValue getUnknownAnnotationValue() {
0N/A return av;
0N/A }
0N/A
0N/A /**
0N/A * Returns the additional argument.
0N/A *
0N/A * @return the additional argument
0N/A */
0N/A public Object getArgument() {
0N/A return parameter;
0N/A }
0N/A}