TypeConstraintException (Java EE 5)

Java EE API


javax.xml.bind Class TypeConstraintException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by javax.xml.bind.TypeConstraintException
All Implemented Interfaces:
Serializable

public class TypeConstraintException
extends RuntimeException

Extends: Throwable > Exception > RuntimeException

此异常指示已检测到存在违反动态检查的类型约束的情况。

此异常可由生成的模式派生 Java 内容类的设置方法抛出。但是,由于快速修复验证是 JAXB 提供者支持的一项可选功能,所以并非所有设置方法都将在违反类型约束时抛出此异常。

如果在调用快速失败设置方法时抛出此异常,则要保证属性值保持不变,如同从未调用过该设置方法一样。

英文文档:

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.

Since:
JAXB1.0
Version:
$Revision: 1.1 $
Author:
  • Ryan Shoemaker, Sun Microsystems, Inc.
  • Joe Fialli, Sun Microsystems, Inc.
See Also:
ValidationEvent, Serialized Form

Constructor Summary
 
Method Summary
 String
 Throwable
 void
 void
 void
 String
 
Methods inherited from class java.lang.Throwable
 
Methods inherited from class java.lang.Object
 

Constructor Detail

public TypeConstraintException(String message)
构造带指定详细消息的 TypeConstraintException。errorCode 和 linkedException 将默认为 null。
message 对异常的描述
英文文档:

TypeConstraintException

public TypeConstraintException(String message)
Construct a TypeConstraintException with the specified detail message. The errorCode and linkedException will default to null.

Parameters:
message - a description of the exception


public TypeConstraintException(String message, String errorCode)
构造带指定详细消息和特定于供应商的 errorCode 的 TypeConstraintException。linkedException 将默认为 null。
message 对异常的描述
errorCode 指定特定于供应商的错误代码的字符串
英文文档:

TypeConstraintException

public TypeConstraintException(String message,
                               String errorCode)
Construct a TypeConstraintException with the specified detail message and vendor specific errorCode. The linkedException will default to null.

Parameters:
message - a description of the exception
errorCode - a string specifying the vendor specific error code


public TypeConstraintException(Throwable exception)
构造带有一个 linkedException 的 TypeConstraintException。详细消息和特定于供应商的 errorCode 将默认为 null。
exception 链接的异常
英文文档:

TypeConstraintException

public TypeConstraintException(Throwable exception)
Construct a TypeConstraintException with a linkedException. The detail message and vendor specific errorCode will default to null.

Parameters:
exception - the linked exception


public TypeConstraintException(String message, Throwable exception)
构造带指定详细消息和 linkedException 的 TypeConstraintException。errorCode 将默认为 null。
message 对异常的描述
exception 链接的异常
英文文档:

TypeConstraintException

public TypeConstraintException(String message,
                               Throwable exception)
Construct a TypeConstraintException with the specified detail message and linkedException. The errorCode will default to null.

Parameters:
message - a description of the exception
exception - the linked exception


public TypeConstraintException(String message, String errorCode, Throwable exception)
构造带指定的详细消息、特定于供应商的 errorCode 和 linkedException 的 TypeConstraintException。
message 对异常的描述
errorCode 指定特定于供应商的错误代码的字符串
exception 链接的异常
英文文档:

TypeConstraintException

public TypeConstraintException(String message,
                               String errorCode,
                               Throwable exception)
Construct a TypeConstraintException with the specified detail message, vendor specific errorCode, and linkedException.

Parameters:
message - a description of the exception
errorCode - a string specifying the vendor specific error code
exception - the linked exception

Method Detail

public String getErrorCode()
获取特定于供应商的错误代码。
return 指定特定于供应商的错误代码的字符串
英文文档:

getErrorCode

public String getErrorCode()
Get the vendor specific error code

Returns:
a string specifying the vendor specific error code

public Throwable getLinkedException()
获取链接的异常。
return 链接的异常;如果不存在,则返回 null
英文文档:

getLinkedException

public Throwable getLinkedException()
Get the linked exception

Returns:
the linked Exception, null if none exists

public void setLinkedException(Throwable exception)
添加一个链接的异常。
exception 链接的异常(允许使用 null 值,该值指示链接的异常不存在或者是未知的)。
英文文档:

setLinkedException

public void setLinkedException(Throwable exception)
Add a linked Exception.

Parameters:
exception - the linked Exception (A null value is permitted and indicates that the linked exception does not exist or is unknown).

public String toString()
返回此 TypeConstraintException 的简短描述。
英文文档:

toString

public String toString()
Returns a short description of this TypeConstraintException.

Overrides:
toString in class Throwable

public void printStackTrace(java.io.PrintStream s)
打印此 TypeConstraintException 及其对 PrintStream 的堆栈跟踪(如果为非 null,则包括该 linkedException 的堆栈跟踪)。
s 用于输出的 PrintStream
英文文档:

printStackTrace

public void printStackTrace(PrintStream s)
Prints this TypeConstraintException and its stack trace (including the stack trace of the linkedException if it is non-null) to the PrintStream.

Overrides:
printStackTrace in class Throwable
Parameters:
s - PrintStream to use for output

public void printStackTrace()
打印此 TypeConstraintException 及其对 System.err 的堆栈跟踪(如果为非 null,则包括 linkedException 的堆栈跟踪。
英文文档:

printStackTrace

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.

Overrides:
printStackTrace in class Throwable


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!