1 /*
   2  * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javax.xml.bind;
  27 
  28 /**
  29  * This exception indicates that an error has occurred while performing
  30  * a marshal operation that the provider is unable to recover from.
  31  *
  32  * <p>
  33  * The <tt>ValidationEventHandler</tt> can cause this exception to be thrown
  34  * during the marshal operations.  See
  35  * {@link ValidationEventHandler#handleEvent(ValidationEvent)
  36  * ValidationEventHandler.handleEvent(ValidationEvent)}.
  37  *
  38  * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
  39  * @see JAXBException
  40  * @see Marshaller
  41  * @since 1.6, JAXB 1.0
  42  */
  43 public class MarshalException extends JAXBException {
  44 
  45     /**
  46      * Construct a MarshalException with the specified detail message.  The
  47      * errorCode and linkedException will default to null.
  48      *
  49      * @param message a description of the exception
  50      */
  51     public MarshalException( String message ) {
  52         this( message, null, null );
  53     }
  54 
  55     /**
  56      * Construct a MarshalException with the specified detail message and vendor
  57      * specific errorCode.  The linkedException will default to null.
  58      *
  59      * @param message a description of the exception
  60      * @param errorCode a string specifying the vendor specific error code
  61      */
  62     public MarshalException( String message, String errorCode ) {
  63         this( message, errorCode, null );
  64     }
  65 
  66     /**
  67      * Construct a MarshalException with a linkedException.  The detail message and
  68      * vendor specific errorCode will default to null.
  69      *
  70      * @param exception the linked exception
  71      */
  72     public MarshalException( Throwable exception ) {
  73         this( null, null, exception );
  74     }
  75 
  76     /**
  77      * Construct a MarshalException with the specified detail message and
  78      * linkedException.  The errorCode will default to null.
  79      *
  80      * @param message a description of the exception
  81      * @param exception the linked exception
  82      */
  83     public MarshalException( String message, Throwable exception ) {
  84         this( message, null, exception );
  85     }
  86 
  87     /**
  88      * Construct a MarshalException with the specified detail message, vendor
  89      * specific errorCode, and linkedException.
  90      *
  91      * @param message a description of the exception
  92      * @param errorCode a string specifying the vendor specific error code
  93      * @param exception the linked exception
  94      */
  95     public MarshalException( String message, String errorCode, Throwable exception ) {
  96         super( message, errorCode, exception );
  97     }
  98 
  99 }