001 /*
002 * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004 *
005 * This code is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU General Public License version 2 only, as
007 * published by the Free Software Foundation. Sun designates this
008 * particular file as subject to the "Classpath" exception as provided
009 * by Sun in the LICENSE file that accompanied this code.
010 *
011 * This code is distributed in the hope that it will be useful, but WITHOUT
012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014 * version 2 for more details (a copy is included in the LICENSE file that
015 * accompanied this code).
016 *
017 * You should have received a copy of the GNU General Public License version
018 * 2 along with this work; if not, write to the Free Software Foundation,
019 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020 *
021 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022 * CA 95054 USA or visit www.sun.com if you need additional information or
023 * have any questions.
024 */
025
026 package javax.xml.bind;
027
028 /**
029 * This exception indicates that an error has occurred while performing
030 * an unmarshal operation that prevents the JAXB Provider from completing
031 * the operation.
032 *
033 * <p>
034 * The <tt>ValidationEventHandler</tt> can cause this exception to be thrown
035 * during the unmarshal operations. See
036 * {@link ValidationEventHandler#handleEvent(ValidationEvent)
037 * ValidationEventHandler.handleEvent(ValidationEvent)}.
038 *
039 * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
040 * @version $Revision: 1.2 $
041 * @see JAXBException
042 * @see Unmarshaller
043 * @see ValidationEventHandler
044 * @since JAXB1.0
045 */
046 public class UnmarshalException extends JAXBException {
047
048 /**
049 * Construct an UnmarshalException with the specified detail message. The
050 * errorCode and linkedException will default to null.
051 *
052 * @param message a description of the exception
053 */
054 public UnmarshalException(String message) {
055 this (message, null, null);
056 }
057
058 /**
059 * Construct an UnmarshalException with the specified detail message and vendor
060 * specific errorCode. The linkedException will default to null.
061 *
062 * @param message a description of the exception
063 * @param errorCode a string specifying the vendor specific error code
064 */
065 public UnmarshalException(String message, String errorCode) {
066 this (message, errorCode, null);
067 }
068
069 /**
070 * Construct an UnmarshalException with a linkedException. The detail message and
071 * vendor specific errorCode will default to null.
072 *
073 * @param exception the linked exception
074 */
075 public UnmarshalException(Throwable exception) {
076 this (null, null, exception);
077 }
078
079 /**
080 * Construct an UnmarshalException with the specified detail message and
081 * linkedException. The errorCode will default to null.
082 *
083 * @param message a description of the exception
084 * @param exception the linked exception
085 */
086 public UnmarshalException(String message, Throwable exception) {
087 this (message, null, exception);
088 }
089
090 /**
091 * Construct an UnmarshalException with the specified detail message, vendor
092 * specific errorCode, and linkedException.
093 *
094 * @param message a description of the exception
095 * @param errorCode a string specifying the vendor specific error code
096 * @param exception the linked exception
097 */
098 public UnmarshalException(String message, String errorCode,
099 Throwable exception) {
100 super(message, errorCode, exception);
101 }
102
103 }
|