Top Description Fields Constructors Methods
javax.xml.bind

public Class TypeConstraintException

extends RuntimeException
Class Inheritance

This exception indicates that a violation of a dynamically checked type constraint was detected.

This exception can be thrown by the generated setter methods of the schema derived Java content classes. However, since fail-fast validation is an optional feature for JAXB Providers to support, not all setter methods will throw this exception when a type constraint is violated.

If this exception is throw while invoking a fail-fast setter, the value of the property is guaranteed to remain unchanged, as if the setter were never called.

Author
Since
1.6, JAXB 1.0
See Also
ValidationEvent

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
TypeConstraintException(String
a description of the exception
message
)

Construct a TypeConstraintException with the specified detail message.

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

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

public
TypeConstraintException(Throwable
the linked exception
exception
)

Construct a TypeConstraintException with a linkedException.

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

Construct a TypeConstraintException with the specified detail message and linkedException.

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

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

Method Summary

Modifier and TypeMethod and Description
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 TypeConstraintException 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 TypeConstraintException and its stack trace (including the stack trace of the linkedException if it is non-null) to System.err.
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 TypeConstraintException.

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.RuntimeException.serialVersionUID.

Constructor Detail

TypeConstraintExceptionback to summary
public TypeConstraintException(String message)

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

Parameters
message:String

a description of the exception

TypeConstraintExceptionback to summary
public TypeConstraintException(String message, String errorCode)

Construct a TypeConstraintException 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

TypeConstraintExceptionback to summary
public TypeConstraintException(Throwable exception)

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

Parameters
exception:Throwable

the linked exception

TypeConstraintExceptionback to summary
public TypeConstraintException(String message, Throwable exception)

Construct a TypeConstraintException 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

TypeConstraintExceptionback to summary
public TypeConstraintException(String message, String errorCode, Throwable exception)

Construct a TypeConstraintException 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

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 TypeConstraintException 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 TypeConstraintException and its stack trace (including the stack trace of the linkedException if it is non-null) to System.err.

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 TypeConstraintException.

Returns:String

Doc from java.lang.Throwable.toString.

a string representation of this throwable.