FileDocCategorySizeDatePackage
JAXBException.javaAPI DocJava SE 6 API4724Tue Jun 10 00:27:04 BST 2008javax.xml.bind

JAXBException

public class JAXBException extends Exception
This is the root exception class for all JAXB exceptions.
author
  • Ryan Shoemaker, Sun Microsystems, Inc.
version
$Revision: 1.3 $ $Date: 2004/10/22 15:46:02 $
see
JAXBContext
see
Marshaller
see
Unmarshaller
since
JAXB1.0

Fields Summary
private String
errorCode
Vendor specific error code
private Throwable
linkedException
Exception reference
static final long
serialVersionUID
Constructors Summary
public JAXBException(String message)
Construct a JAXBException with the specified detail message. The errorCode and linkedException will default to null.

param
message a description of the exception


                                   
       
        this( message, null, null );
    
public JAXBException(String message, String errorCode)
Construct a JAXBException with the specified detail message and vendor specific errorCode. The linkedException will default to null.

param
message a description of the exception
param
errorCode a string specifying the vendor specific error code

        this( message, errorCode, null );
    
public JAXBException(Throwable exception)
Construct a JAXBException with a linkedException. The detail message and vendor specific errorCode will default to null.

param
exception the linked exception

        this( null, null, exception );
    
public JAXBException(String message, Throwable exception)
Construct a JAXBException with the specified detail message and linkedException. The errorCode will default to null.

param
message a description of the exception
param
exception the linked exception

        this( message, null, exception );
    
public JAXBException(String message, String errorCode, Throwable exception)
Construct a JAXBException with the specified detail message, vendor specific errorCode, and linkedException.

param
message a description of the exception
param
errorCode a string specifying the vendor specific error code
param
exception the linked exception

        super( message );
        this.errorCode = errorCode;
        this.linkedException = exception;
    
Methods Summary
public java.lang.ThrowablegetCause()

        return linkedException;
    
public java.lang.StringgetErrorCode()
Get the vendor specific error code

return
a string specifying the vendor specific error code

        return this.errorCode;
    
public java.lang.ThrowablegetLinkedException()
Get the linked exception

return
the linked Exception, null if none exists

        return linkedException;
    
public voidprintStackTrace(java.io.PrintStream s)
Prints this JAXBException and its stack trace (including the stack trace of the linkedException if it is non-null) to the PrintStream.

param
s PrintStream to use for output

        super.printStackTrace(s);
    
public voidprintStackTrace()
Prints this JAXBException and its stack trace (including the stack trace of the linkedException if it is non-null) to System.err.

        super.printStackTrace();
    
public voidprintStackTrace(java.io.PrintWriter s)
Prints this JAXBException and its stack trace (including the stack trace of the linkedException if it is non-null) to the PrintWriter.

param
s PrintWriter to use for output

        super.printStackTrace(s);
    
public synchronized voidsetLinkedException(java.lang.Throwable exception)
Add a linked Exception.

param
exception the linked Exception (A null value is permitted and indicates that the linked exception does not exist or is unknown).

        this.linkedException = exception;
    
public java.lang.StringtoString()
Returns a short description of this JAXBException.

        return linkedException == null ? 
            super.toString() :
            super.toString() + "\n - with linked exception:\n[" +
                                linkedException.toString()+ "]";