public interface ValidationEventHandler
如果应用程序需要实现自定义事件处理,它必须实现这个接口,然后用Unmarshaller
,登记的Validator
,或Marshaller
。JAXB提供程序将报告验证错误和警告的解包,元帅中,验证操作这些事件处理程序。
如果handleEvent方法抛出unchecked异常,JAXB提供者必须治疗,如果方法返回false,有效地终止任何操作正在进行时(数据,验证,或元帅)。
修改java内容树在你的事件处理程序定义的规范,可能会导致意外的行为。
失败返回false从handleEvent方法在遇到致命错误未定义的规范,可能会导致意外的行为。
默认事件处理程序
See: Validator javadocs
Unmarshaller
,
Validator
,
Marshaller
,
ValidationEvent
,
ValidationEventCollector
Modifier and Type | Method and Description |
---|---|
boolean |
handleEvent(ValidationEvent event)
接收验证警告或错误的通知。
|
boolean handleEvent(ValidationEvent event)
ValidationEventLocator
嵌入它表明发生错误或警告。
如果从这个方法抛出unchecked异常,JAXB提供程序将把它当作如果方法返回false,中断当前的数据,验证操作,或元帅。
event
的封装验证事件信息。如果这个参数为空,则是一个提供程序错误。
IllegalArgumentException
-如果事件对象为空。
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.