javax.xml.bind

Class JAXBException

Known Direct Subclasses:
MarshalException, PMException, PropertyException, UnmarshalException, ValidationException

public class JAXBException
extends Exception

This is the main exception class of JAXB. All other exception classes (except the TypeConstraintException, which is a java.lang.RuntimeException are derived from the JAXBException.
Author:
JSR-31
Since:
JAXB1.0

Constructor Summary

JAXBException(String pMessage)
Creates a new JAXBException with the specified detail message.
JAXBException(String pMessage, String pErrorCode)
Creates a new JAXBException with the specified detail message and vendor specific error code.
JAXBException(String pMessage, String pErrorCode, Throwable pLinkedException)
Creates a new JAXBException with the specified detail message, error code, and linked exception.
JAXBException(String pMessage, Throwable pLinkedException)
Creates a new JAXBException with the specified detail message and linked exception.
JAXBException(Throwable pLinkedException)
Creates a new JAXBException with the specified linked exception.

Method Summary

String
getErrorCode()
Returns the vendor specific error code, if any, or null.
Throwable
getLinkedException()
Returns the linked exception, if any, or null.
void
printStackTrace()
void
printStackTrace(PrintStream pStream)
void
printStackTrace(PrintWriter pWriter)
void
setLinkedException(Throwable pLinkedException)
Sets the linked exception.
String
toString()
Converts the linked exception into a String.

Constructor Details

JAXBException

public JAXBException(String pMessage)
Creates a new JAXBException with the specified detail message.
Parameters:
pMessage - The detail message.

JAXBException

public JAXBException(String pMessage,
                     String pErrorCode)
Creates a new JAXBException with the specified detail message and vendor specific error code.
Parameters:
pMessage - The detail message.
pErrorCode - The error code.

JAXBException

public JAXBException(String pMessage,
                     String pErrorCode,
                     Throwable pLinkedException)
Creates a new JAXBException with the specified detail message, error code, and linked exception.
Parameters:
pMessage - The detail message.
pErrorCode - The vendor specific error code.
pLinkedException - The linked exception.

JAXBException

public JAXBException(String pMessage,
                     Throwable pLinkedException)
Creates a new JAXBException with the specified detail message and linked exception.
Parameters:
pMessage - The detail message.
pLinkedException - The linked exception.

JAXBException

public JAXBException(Throwable pLinkedException)
Creates a new JAXBException with the specified linked exception.
Parameters:
pLinkedException - The linked exception.

Method Details

getErrorCode

public String getErrorCode()
Returns the vendor specific error code, if any, or null.

getLinkedException

public Throwable getLinkedException()
Returns the linked exception, if any, or null.

printStackTrace

public void printStackTrace()

printStackTrace

public void printStackTrace(PrintStream pStream)

printStackTrace

public void printStackTrace(PrintWriter pWriter)

setLinkedException

public void setLinkedException(Throwable pLinkedException)
Sets the linked exception.
Parameters:
pLinkedException - The linked exception or null.

toString

public String toString()
Converts the linked exception into a String. Overridden, because the returned string should contain the vendor specific error code, if any.