ValidationEventImpl (Java EE 5)

Java EE API


javax.xml.bind.helpers Class ValidationEventImpl

java.lang.Object
  extended by javax.xml.bind.helpers.ValidationEventImpl
All Implemented Interfaces:
ValidationEvent
Direct Known Subclasses:
NotIdentifiableEventImpl, ParseConversionEventImpl, PrintConversionEventImpl

public class ValidationEventImpl
extends Object
implements ValidationEvent

Implements: ValidationEvent

ValidationEvent 接口的默认实现。

允许 JAXB 提供者使用实现了 ValidationEvent 接口的任何类。提供此类只是为了方便使用。

英文文档:

Default implementation of the ValidationEvent interface.

JAXB providers are allowed to use whatever class that implements the ValidationEvent interface. This class is just provided for a convenience.

Since:
JAXB1.0
Version:
$Revision: 1.1 $
Author:
  • Kohsuke Kawaguchi, Sun Microsystems, Inc.
See Also:
Validator, ValidationEventHandler, ValidationEvent, ValidationEventLocator

Field Summary
 
Fields inherited from interface javax.xml.bind.ValidationEvent
 
Constructor Summary
 
Method Summary
 Throwable
 ValidationEventLocator
 String
 int
 void
 void
 void
 void
 String
 
Methods inherited from class java.lang.Object
 

Constructor Detail

public ValidationEventImpl(int _severity, String _message, ValidationEventLocator _locator)
创建新的 ValidationEventImpl。
_severity 此事件的 severity 值。必须是 ValidationEvent.WARNING、ValidationEvent.ERROR 或 ValidationEvent.FATAL_ERROR 之一
_message 此事件的 Locator 对象,可以为 null。
_locator 一个可以提供事件的其他信息的可选链接异常,可以为 null。
ThrowsIllegalArgumentException: 如果提供了非法的 severity 字段
英文文档:

ValidationEventImpl

public ValidationEventImpl(int _severity,
                           String _message,
                           ValidationEventLocator _locator)
Create a new ValidationEventImpl.

Parameters:
_severity - The severity value for this event. Must be one of ValidationEvent.WARNING, ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR
_message - The text message for this event - may be null.
_locator - The locator object for this event - may be null.
Throws:
IllegalArgumentException - if an illegal severity field is supplied


public ValidationEventImpl(int _severity, String _message, ValidationEventLocator _locator, Throwable _linkedException)
创建新的 ValidationEventImpl。
_severity 此事件的 severity 值。必须是 ValidationEvent.WARNING、ValidationEvent.ERROR 或 ValidationEvent.FATAL_ERROR 之一
_message 此事件的 Locator 对象,可以为 null。
_locator 一个可以提供事件的其他信息的可选链接异常,可以为 null。
_linkedException 一个可以提供事件的其他信息的可选链接异常,可以为 null。
ThrowsIllegalArgumentException: 如果提供了非法的 severity 字段
英文文档:

ValidationEventImpl

public ValidationEventImpl(int _severity,
                           String _message,
                           ValidationEventLocator _locator,
                           Throwable _linkedException)
Create a new ValidationEventImpl.

Parameters:
_severity - The severity value for this event. Must be one of ValidationEvent.WARNING, ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR
_message - The text message for this event - may be null.
_locator - The locator object for this event - may be null.
_linkedException - An optional linked exception that may provide additional information about the event - may be null.
Throws:
IllegalArgumentException - if an illegal severity field is supplied

Method Detail

public int getSeverity()
英文文档:

getSeverity

public int getSeverity()
Description copied from interface: ValidationEvent
Retrieve the severity code for this warning/error.

Must be one of ValidationError.WARNING, ValidationError.ERROR, or ValidationError.FATAL_ERROR.

Specified by:
getSeverity in interface ValidationEvent
Returns:
the severity code for this warning/error

public void setSeverity(int _severity)
设置此事件的 severity 字段。
_severity 必须是 ValidationEvent.WARNING、ValidationEvent.ERROR 或 ValidationEvent.FATAL_ERROR 之一。
ThrowsIllegalArgumentException: 如果提供了非法的 severity 字段
英文文档:

setSeverity

public void setSeverity(int _severity)
Set the severity field of this event.

Parameters:
_severity - Must be one of ValidationEvent.WARNING, ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR.
Throws:
IllegalArgumentException - if an illegal severity field is supplied

public String getMessage()
英文文档:

getMessage

public String getMessage()
Description copied from interface: ValidationEvent
Retrieve the text message for this warning/error.

Specified by:
getMessage in interface ValidationEvent
Returns:
the text message for this warning/error or null if one wasn't set

public void setMessage(String _message)
设置此事件的 message 字段。
_message 字符串消息,可以为 null。
英文文档:

setMessage

public void setMessage(String _message)
Set the message field of this event.

Parameters:
_message - String message - may be null.

public Throwable getLinkedException()
英文文档:

getLinkedException

public Throwable getLinkedException()
Description copied from interface: ValidationEvent
Retrieve the linked exception for this warning/error.

Specified by:
getLinkedException in interface ValidationEvent
Returns:
the linked exception for this warning/error or null if one wasn't set

public void setLinkedException(Throwable _linkedException)
设置此事件的 linked exception 字段。
_linkedException 可选链接异常,可以为 null。
英文文档:

setLinkedException

public void setLinkedException(Throwable _linkedException)
Set the linked exception field of this event.

Parameters:
_linkedException - Optional linked exception - may be null.

public ValidationEventLocator getLocator()
英文文档:

getLocator

public ValidationEventLocator getLocator()
Description copied from interface: ValidationEvent
Retrieve the locator for this warning/error.

Specified by:
getLocator in interface ValidationEvent
Returns:
the locator that indicates where the warning/error occurred

public void setLocator(ValidationEventLocator _locator)
设置此事件的 Locator 对象。
_locator 定位符,可以为 null。
英文文档:

setLocator

public void setLocator(ValidationEventLocator _locator)
Set the locator object for this event.

Parameters:
_locator - The locator - may be null.

public String toString()
以有助于调试的格式返回此对象的字符串表示形式。
See also equals(Object)
英文文档:

toString

public String toString()
Returns a string representation of this object in a format helpful to debugging.

Overrides:
toString in class Object
See Also:
Object.equals(Object)


Submit a bug or feature

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

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

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