public class TypeConstraintException extends RuntimeException
这种异常可以通过生成java类派生内容图式的setter方法抛出。然而,由于快速失败验证是JAXB供应商支持一个可选的功能,不是所有的setter方法会抛出该异常类型时是违反约束。
如果该异常抛出时调用一个快速失败的二传,该属性的值是保证不变的情况下,如果二传从未被称为。
ValidationEvent
,
Serialized Form
Constructor and Description |
---|
TypeConstraintException(String message)
构建一个typeconstraintexception指定详细信息。
|
TypeConstraintException(String message, String errorCode)
构建一个typeconstraintexception指定详细信息和供应商特定的错误代码。
|
TypeConstraintException(String message, String errorCode, Throwable exception)
构建指定详细信息的一个typeconstraintexception,供应商特定的错误代码,并linkedexception。
|
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和堆栈跟踪(包括对linkedexception堆栈跟踪,如果它是非空)来
System.err。
|
void |
printStackTrace(PrintStream s)
打印该typeconstraintexception和堆栈跟踪(包括对linkedexception堆栈跟踪,如果它是非空)的可。
|
void |
setLinkedException(Throwable exception)
添加一个链接的异常。
|
String |
toString()
返回本typeconstraintexception简短的描述。
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace
public 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
-链接的例外(null值是允许的,表明链接的异常不存在或未知)。
public String toString()
public void printStackTrace(PrintStream s)
printStackTrace
方法重写,继承类
Throwable
s
-可用于输出
public void printStackTrace()
printStackTrace
方法重写,继承类
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.