public class TypeConstraintException extends RuntimeException
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.
ValidationEvent,
Serialized Form
| Constructor and Description |
|---|
TypeConstraintException(String
Construct a TypeConstraintException with the specified detail message.
|
TypeConstraintException(String
Construct a TypeConstraintException with the specified detail message and vendor specific errorCode.
|
TypeConstraintException(String
Construct a TypeConstraintException with the specified detail message, vendor specific errorCode, and linkedException.
|
TypeConstraintException(String
Construct a TypeConstraintException with the specified detail message and linkedException.
|
TypeConstraintException(Throwable
Construct a TypeConstraintException with a linkedException.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getErrorCode()
Get the vendor specific error code
|
Throwable |
getLinkedException()
Get the linked exception
|
void |
printStackTrace()
Prints this TypeConstraintException and its stack trace (including the stack trace of the linkedException if it is non-null) to
System.err.
|
void |
printStackTrace(PrintStream
Prints this TypeConstraintException and its stack trace (including the stack trace of the linkedException if it is non-null) to the PrintStream.
|
void |
setLinkedException(Throwable
Add a linked Exception.
|
String |
toString()
Returns a short description of this TypeConstraintException.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTracepublic TypeConstraintException(Stringmessage)
message - a description of the exception
public TypeConstraintException(Stringmessage, String errorCode)
message - a description of the exception
errorCode - a string specifying the vendor specific error code
public TypeConstraintException(Throwableexception)
exception - the linked exception
public TypeConstraintException(Stringmessage, Throwable exception)
message - a description of the exception
exception - the linked exception
public TypeConstraintException(Stringmessage, String errorCode, Throwable exception)
message - a description of the exception
errorCode - a string specifying the vendor specific error code
exception - the linked exception
public StringgetErrorCode()
public ThrowablegetLinkedException()
public void setLinkedException(Throwableexception)
exception - the linked Exception (A null value is permitted and indicates that the linked exception does not exist or is unknown).
public StringtoString()
public void printStackTrace(PrintStreams)
printStackTrace in class
Throwable
s - PrintStream to use for output
public void printStackTrace()