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 element was encountered. This
0N/A * can occur if the language evolves and new kinds of elements are
0N/A * added to the {@code Element} hierarchy. May be thrown by an
0N/A * {@linkplain ElementVisitor element visitor} to indicate that the
0N/A * visitor was created for a prior version of the language.
0N/A *
0N/A * @author Joseph D. Darcy
0N/A * @author Scott Seligman
0N/A * @author Peter von der Ahé
0N/A * @see ElementVisitor#visitUnknown
0N/A * @since 1.6
0N/A */
215N/Apublic class UnknownElementException extends UnknownEntityException {
0N/A
0N/A private static final long serialVersionUID = 269L;
0N/A
0N/A private transient Element element;
0N/A private transient Object parameter;
0N/A
0N/A /**
0N/A * Creates a new {@code UnknownElementException}. The {@code p}
0N/A * parameter may be used to pass in an additional argument with
0N/A * information about the context in which the unknown element was
0N/A * encountered; for example, the visit methods of {@link
0N/A * ElementVisitor} may pass in their additional parameter.
0N/A *
0N/A * @param e the unknown element, may be {@code null}
0N/A * @param p an additional parameter, may be {@code null}
0N/A */
0N/A public UnknownElementException(Element e, Object p) {
0N/A super("Unknown element: " + e);
0N/A element = e;
0N/A this.parameter = p;
0N/A }
0N/A
0N/A /**
0N/A * Returns the unknown element.
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 Element getUnknownElement() {
0N/A return element;
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}