javax.xml.bind

Class JAXBException

public class JAXBException extends Exception

This is the main exception class of JAXB. All other exception classes (except the {@link javax.xml.bind.TypeConstraintException}, which is a {@link java.lang.RuntimeException} are derived from the JAXBException.

Since: JAXB1.0

Author: JSR-31

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(Throwable pLinkedException)

Creates a new JAXBException with the specified linked exception.

JAXBException(String pMessage, Throwable pLinkedException)

Creates a new JAXBException with the specified detail message and linked exception.

JAXBException(String pMessage, String pErrorCode, Throwable pLinkedException)

Creates a new JAXBException with the specified detail message, error code, and linked exception.

Method Summary
StringgetErrorCode()

Returns the vendor specific error code, if any, or null.

ThrowablegetLinkedException()

Returns the linked exception, if any, or null.

voidprintStackTrace()
voidprintStackTrace(PrintStream pStream)
voidprintStackTrace(PrintWriter pWriter)
voidsetLinkedException(Throwable pLinkedException)

Sets the linked exception.

StringtoString()

Converts the linked exception into a String.

Constructor Detail

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(Throwable pLinkedException)

Creates a new JAXBException with the specified linked exception.

Parameters: 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(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.

Method Detail

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.