public class TypeConstraintException extends RuntimeException
该异常可以由生成的派生Java内容类的setter方法抛出。 但是,由于故障快速验证是JAXB提供程序支持的可选功能,当违反类型约束时,并非所有setter方法都将抛出此异常。
如果在调用失败快速设置器时抛出此异常,则该属性的值将保持不变,就像从未调用setter一样。
ValidationEvent , Serialized Form 
       | Constructor and Description | 
|---|
| TypeConstraintException(String message)
              使用指定的详细消息构造TypeConstraintException。 
             | 
| TypeConstraintException(String message, String errorCode)
              构造具有指定的详细消息和供应商特定的错误代码的TypeConstraintException。 
             | 
| TypeConstraintException(String message, String errorCode, Throwable exception)
              构造具有指定的详细消息,供应商特定的错误代码和linkedException的TypeConstraintException。 
             | 
| TypeConstraintException(String message, Throwable exception)
              使用指定的详细消息和linkedException构造TypeConstraintException。 
             | 
| TypeConstraintException(Throwable exception)
              构造一个带有LinkedException的TypeConstraintException。 
             | 
| Modifier and Type | Method and Description | 
|---|---|
| String | getErrorCode()
              获取供应商特定的错误代码 
             | 
| Throwable | getLinkedException()
              获取链接的异常 
             | 
| void | printStackTrace()
              将此TypeConstraintException及其堆栈跟踪(包括链接异常的堆栈跟踪(如果非空)) 
             打印到 
             System.err 。 
             | 
| void | printStackTrace(PrintStream s)
              将PrintCryptException及其堆栈跟踪(包括linkedException的堆栈跟踪(如果非空))打印到PrintStream。 
             | 
| void | setLinkedException(Throwable exception)
              添加链接异常。 
             | 
| String | toString()
              返回此TypeConstraintException的简短描述。 
             | 
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTracepublic TypeConstraintException(String message)
message - 异常的描述 
           public TypeConstraintException(String message, String errorCode)
message - 异常的描述 
           errorCode - 指定供应商特定错误代码的字符串 
           public TypeConstraintException(Throwable exception)
exception - 链接异常 
           public TypeConstraintException(String message, Throwable exception)
message - 异常的描述 
           exception - 链接异常 
           public String getErrorCode()
public Throwable getLinkedException()
public void setLinkedException(Throwable exception)
exception - 链接的异常(允许空值,表示链接的异常不存在或未知)。 
           public String toString()
public void printStackTrace(PrintStream s)
printStackTrace在 
            Throwable 
           s - 用于输出的PrintStream 
           public void printStackTrace()
printStackTrace in class  
            Throwable 
            Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.