public class ValidationEventCollector extends Object implements ValidationEventHandler
ValidationEventHandler收集所有事件的实现。 
       要使用此类,请创建一个新实例,并将其传递给Validator,Unmarshaller,Marshaller类的setEventHandler方法。 调用验证或解密完成后,调用getEvents方法来检索所有报告的错误和警告。
Validator , ValidationEventHandler , ValidationEvent , ValidationEventLocator 
       | Constructor and Description | 
|---|
| ValidationEventCollector() | 
| Modifier and Type | Method and Description | 
|---|---|
| ValidationEvent[] | getEvents()
              返回一组ValidationEvent对象,其中包含每个收集的错误和警告的副本。 
             | 
| boolean | handleEvent(ValidationEvent event)
              接收验证警告或错误的通知。 
             | 
| boolean | hasEvents()
              如果此事件收集器至少包含一个ValidationEvent,则返回true。 
             | 
| void | reset()
              清除所有收集的错误和警告。 
             | 
public ValidationEvent[] getEvents()
public void reset()
public boolean hasEvents()
public boolean handleEvent(ValidationEvent event)
ValidationEventHandler 
          ValidationEventLocator ,指出发生错误或警告的位置。 
           如果从该方法抛出未检查的运行时异常,则JAXB提供程序将将其视为返回false并中断当前解组,验证或组织操作。
handleEvent在接口 
            ValidationEventHandler 
           event - 封装的验证事件信息。 
            如果此参数为空,则为提供者错误。 
            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.