001 /* 002 * $Id: MarshalException.java,v 1.7 2002/11/11 18:58:20 ryans Exp $ 003 * 004 * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. 005 * 006 * This software is the proprietary information of Sun Microsystems, Inc. 007 * Use is subject to license terms. 008 * 009 */ 010 011 package javax.xml.bind; 012 013 /** 014 * This exception indicates that an error has occured while performing 015 * a marshal operation that the provider is unable to recover from. 016 * 017 * <p> 018 * The <tt>ValidationEventHandler</tt> can cause this exception to be thrown 019 * during the marshal operations. See 020 * {@link ValidationEventHandler#handleEvent(ValidationEvent) 021 * ValidationEventHandler.handleEvent(ValidationEvent)}. 022 * 023 * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul> 024 * @version $Revision: 1.7 $ 025 * @see JAXBException 026 * @see Marshaller 027 * @since JAXB1.0 028 */ 029 public class MarshalException extends JAXBException { 030 031 /** 032 * Construct a MarshalException with the specified detail message. The 033 * errorCode and linkedException will default to null. 034 * 035 * @param message a description of the exception 036 */ 037 public MarshalException( String message ) { 038 this( message, null, null ); 039 } 040 041 /** 042 * Construct a MarshalException with the specified detail message and vendor 043 * specific errorCode. The linkedException will default to null. 044 * 045 * @param message a description of the exception 046 * @param errorCode a string specifying the vendor specific error code 047 */ 048 public MarshalException( String message, String errorCode ) { 049 this( message, errorCode, null ); 050 } 051 052 /** 053 * Construct a MarshalException with a linkedException. The detail message and 054 * vendor specific errorCode will default to null. 055 * 056 * @param exception the linked exception 057 */ 058 public MarshalException( Throwable exception ) { 059 this( null, null, exception ); 060 } 061 062 /** 063 * Construct a MarshalException with the specified detail message and 064 * linkedException. The errorCode will default to null. 065 * 066 * @param message a description of the exception 067 * @param exception the linked exception 068 */ 069 public MarshalException( String message, Throwable exception ) { 070 this( message, null, exception ); 071 } 072 073 /** 074 * Construct a MarshalException with the specified detail message, vendor 075 * specific errorCode, and linkedException. 076 * 077 * @param message a description of the exception 078 * @param errorCode a string specifying the vendor specific error code 079 * @param exception the linked exception 080 */ 081 public MarshalException( String message, String errorCode, Throwable exception ) { 082 super( message, errorCode, exception ); 083 } 084 085 } 086 087