public interface ValidationEventHandler 
       如果应用程序需要实现自定义的事件处理,它必须实现此接口,然后用要么注册它Unmarshaller ,该Validator ,或Marshaller 。 然后,JAXB提供程序将向这些事件处理程序报告解密,组织和验证操作期间遇到的验证错误和警告。 
如果handleEvent方法抛出未经检查的运行时异常,则JAXB提供程序必须将该方法视为返回false,有效地终止当前正在进行的任何操作(unmarshal,validate或marshal)。
修改事件处理程序中的Java内容树不受规范的限制,并可能导致意外的行为。
遇到致命错误后,未能从handleEvent方法返回虚假的内容未被规范定义,可能会导致意外的行为。
默认事件处理程序
See: Validator javadocs
Unmarshaller , Validator , Marshaller , ValidationEvent , ValidationEventCollector 
       | Modifier and Type | Method and Description | 
|---|---|
| boolean | handleEvent(ValidationEvent event)
              接收验证警告或错误的通知。 
             | 
boolean handleEvent(ValidationEvent event)
ValidationEventLocator ,指示发生错误或警告的位置。 
           如果从该方法抛出未检查的运行时异常,则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.