Top Description Fields Constructors Methods
javax.xml.bind

public Class JAXBException

extends Exception
Class Inheritance
Known Direct Subclasses
javax.xml.bind.MarshalException, javax.xml.bind.PropertyException, javax.xml.bind.UnmarshalException, javax.xml.bind.ValidationException
Imports
java.io.PrintWriter

This is the root exception class for all JAXB exceptions.
Author
Since
1.6, JAXB 1.0
See Also
JAXBContext, Marshaller, Unmarshaller

Field Summary

Modifier and TypeField and Description
private String
errorCode

Vendor specific error code

private volatile Throwable
linkedException

Exception reference

pack-priv static final long

Constructor Summary

AccessConstructor and Description
public
JAXBException(String
a description of the exception
message
)

Construct a JAXBException with the specified detail message.

public
JAXBException(String
a description of the exception
message
,
String
a string specifying the vendor specific error code
errorCode
)

Construct a JAXBException with the specified detail message and vendor specific errorCode.

public
JAXBException(Throwable
the linked exception
exception
)

Construct a JAXBException with a linkedException.

public
JAXBException(String
a description of the exception
message
,
Throwable
the linked exception
exception
)

Construct a JAXBException with the specified detail message and linkedException.

public
JAXBException(String
a description of the exception
message
,
String
a string specifying the vendor specific error code
errorCode
,
Throwable
the linked exception
exception
)

Construct a JAXBException with the specified detail message, vendor specific errorCode, and linkedException.

Method Summary

Modifier and TypeMethod and Description
public Throwable
getCause()

Overrides java.lang.Throwable.getCause.

Returns the cause of this throwable or null if the cause is nonexistent or unknown.
public String

Returns:

a string specifying the vendor specific error code
getErrorCode
()

Get the vendor specific error code

public Throwable

Returns:

the linked Exception, null if none exists
getLinkedException
()

Get the linked exception

public void
printStackTrace(PrintStream
PrintStream to use for output
s
)

Overrides java.lang.Throwable.printStackTrace.

Prints this JAXBException and its stack trace (including the stack trace of the linkedException if it is non-null) to the PrintStream.
public void
printStackTrace()

Overrides java.lang.Throwable.printStackTrace.

Prints this JAXBException and its stack trace (including the stack trace of the linkedException if it is non-null) to System.err.
public void
printStackTrace(PrintWriter
PrintWriter to use for output
s
)

Overrides java.lang.Throwable.printStackTrace.

Prints this JAXBException and its stack trace (including the stack trace of the linkedException if it is non-null) to the PrintWriter.
public void
setLinkedException(Throwable
the linked Exception (A null value is permitted and indicates that the linked exception does not exist or is unknown).
exception
)

Add a linked Exception.

public String
toString()

Overrides java.lang.Throwable.toString.

Returns a short description of this JAXBException.

Field Detail

errorCodeback to summary
private String errorCode

Vendor specific error code

linkedExceptionback to summary
private volatile Throwable linkedException

Exception reference

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides java.lang.Exception.serialVersionUID.

Constructor Detail

JAXBExceptionback to summary
public JAXBException(String message)

Construct a JAXBException with the specified detail message. The errorCode and linkedException will default to null.

Parameters
message:String

a description of the exception

JAXBExceptionback to summary
public JAXBException(String message, String errorCode)

Construct a JAXBException with the specified detail message and vendor specific errorCode. The linkedException will default to null.

Parameters
message:String

a description of the exception

errorCode:String

a string specifying the vendor specific error code

JAXBExceptionback to summary
public JAXBException(Throwable exception)

Construct a JAXBException with a linkedException. The detail message and vendor specific errorCode will default to null.

Parameters
exception:Throwable

the linked exception

JAXBExceptionback to summary
public JAXBException(String message, Throwable exception)

Construct a JAXBException with the specified detail message and linkedException. The errorCode will default to null.

Parameters
message:String

a description of the exception

exception:Throwable

the linked exception

JAXBExceptionback to summary
public JAXBException(String message, String errorCode, Throwable exception)

Construct a JAXBException with the specified detail message, vendor specific errorCode, and linkedException.

Parameters
message:String

a description of the exception

errorCode:String

a string specifying the vendor specific error code

exception:Throwable

the linked exception

Method Detail

getCauseback to summary
public Throwable getCause()

Overrides java.lang.Throwable.getCause.

Doc from java.lang.Throwable.getCause.

Returns the cause of this throwable or null if the cause is nonexistent or unknown. (The cause is the throwable that caused this throwable to get thrown.)

This implementation returns the cause that was supplied via one of the constructors requiring a Throwable, or that was set after creation with the initCause(Throwable) method. While it is typically unnecessary to override this method, a subclass can override it to return a cause set by some other means. This is appropriate for a "legacy chained throwable" that predates the addition of chained exceptions to Throwable. Note that it is not necessary to override any of the PrintStackTrace methods, all of which invoke the getCause method to determine the cause of a throwable.

Returns:Throwable

the cause of this throwable or null if the cause is nonexistent or unknown.

Annotations
@Override
getErrorCodeback to summary
public String getErrorCode()

Get the vendor specific error code

Returns:String

a string specifying the vendor specific error code

getLinkedExceptionback to summary
public Throwable getLinkedException()

Get the linked exception

Returns:Throwable

the linked Exception, null if none exists

printStackTraceback to summary
public void printStackTrace(PrintStream s)

Overrides java.lang.Throwable.printStackTrace.

Prints this JAXBException and its stack trace (including the stack trace of the linkedException if it is non-null) to the PrintStream.

Parameters
s:PrintStream

PrintStream to use for output

printStackTraceback to summary
public void printStackTrace()

Overrides java.lang.Throwable.printStackTrace.

Prints this JAXBException and its stack trace (including the stack trace of the linkedException if it is non-null) to System.err.

printStackTraceback to summary
public void printStackTrace(PrintWriter s)

Overrides java.lang.Throwable.printStackTrace.

Prints this JAXBException and its stack trace (including the stack trace of the linkedException if it is non-null) to the PrintWriter.

Parameters
s:PrintWriter

PrintWriter to use for output

setLinkedExceptionback to summary
public void setLinkedException(Throwable exception)

Add a linked Exception.

Parameters
exception:Throwable

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

toStringback to summary
public String toString()

Overrides java.lang.Throwable.toString.

Returns a short description of this JAXBException.

Returns:String

Doc from java.lang.Throwable.toString.

a string representation of this throwable.