TypeConstraintExceptionpublic class TypeConstraintException extends RuntimeException 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. |
Fields Summary |
---|
private String | errorCodeVendor specific error code | private Throwable | linkedExceptionException reference |
Constructors Summary |
---|
public TypeConstraintException(String message)Construct a TypeConstraintException with the specified detail message. The
errorCode and linkedException will default to null.
this( message, null, null );
| public TypeConstraintException(String message, String errorCode)Construct a TypeConstraintException with the specified detail message and vendor
specific errorCode. The linkedException will default to null.
this( message, errorCode, null );
| public TypeConstraintException(Throwable exception)Construct a TypeConstraintException with a linkedException. The detail message and
vendor specific errorCode will default to null.
this( null, null, exception );
| public TypeConstraintException(String message, Throwable exception)Construct a TypeConstraintException with the specified detail message and
linkedException. The errorCode will default to null.
this( message, null, exception );
| public TypeConstraintException(String message, String errorCode, Throwable exception)Construct a TypeConstraintException with the specified detail message,
vendor specific errorCode, and linkedException.
super( message );
this.errorCode = errorCode;
this.linkedException = exception;
|
Methods Summary |
---|
public java.lang.String | getErrorCode()Get the vendor specific error code
return this.errorCode;
| public java.lang.Throwable | getLinkedException()Get the linked exception
return linkedException;
| public void | printStackTrace(java.io.PrintStream s)Prints this TypeConstraintException and its stack trace (including the stack trace
of the linkedException if it is non-null) to the PrintStream.
if( linkedException != null ) {
linkedException.printStackTrace(s);
s.println("--------------- linked to ------------------");
}
super.printStackTrace(s);
| public void | printStackTrace()Prints this TypeConstraintException and its stack trace (including the stack trace
of the linkedException if it is non-null) to System.err.
printStackTrace(System.err);
| public synchronized void | setLinkedException(java.lang.Throwable exception)Add a linked Exception.
this.linkedException = exception;
| public java.lang.String | toString()Returns a short description of this TypeConstraintException.
return linkedException == null ?
super.toString() :
super.toString() + "\n - with linked exception:\n[" +
linkedException.toString()+ "]";
|
|