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 Jakarta XML Binding 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
| Modifier and Type | Field and Description |
|---|---|
| private String | errorCode
Vendor specific error code |
| private volatile Throwable | linkedException
Exception reference |
| pack-priv static final long |
| Access | Constructor 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. |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: a string specifying the vendor specific error codeGet the vendor specific error code |
| public Throwable | |
| public void | printStackTrace(PrintStream
PrintStream to use for output s)Overrides java. |
| public void | printStackTrace()
Overrides java. 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. |
| errorCode | back to summary |
|---|---|
| private String errorCode Vendor specific error code | |
| linkedException | back to summary |
|---|---|
| private volatile Throwable linkedException Exception reference | |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID | |
| TypeConstraintException | back to summary |
|---|---|
| public TypeConstraintException(String message) Construct a TypeConstraintException with the specified detail message. The errorCode and linkedException will default to null.
| |
| TypeConstraintException | back 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. | |
| TypeConstraintException | back to summary |
|---|---|
| public TypeConstraintException(Throwable exception) Construct a TypeConstraintException with a linkedException. The detail message and vendor specific errorCode will default to null.
| |
| TypeConstraintException | back to summary |
|---|---|
| public TypeConstraintException(String message, Throwable exception) Construct a TypeConstraintException with the specified detail message and linkedException. The errorCode will default to null. | |
| TypeConstraintException | back to summary |
|---|---|
| public TypeConstraintException(String message, String errorCode, Throwable exception) Construct a TypeConstraintException with the specified detail message, vendor specific errorCode, and linkedException. | |
| getErrorCode | back to summary |
|---|---|
| public String getErrorCode() Get the vendor specific error code
| |
| getLinkedException | back to summary |
|---|---|
| public Throwable getLinkedException() Get the linked exception
| |
| printStackTrace | back to summary |
|---|---|
| public void printStackTrace(PrintStream s) Overrides java. Prints this TypeConstraintException and its stack trace (including the stack trace of the linkedException if it is non-null) to the PrintStream.
| |
| printStackTrace | back to summary |
|---|---|
| public void printStackTrace() Overrides java. Prints this TypeConstraintException and its stack trace (including the stack trace
of the linkedException if it is non-null) to
| |
| setLinkedException | back to summary |
|---|---|
| public void setLinkedException(Throwable exception) Add a linked Exception.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a short description of this TypeConstraintException.
| |