public class ValidationEventCollector extends Object implements ValidationEventHandler
ValidationEventHandler
实施,收集所有的事件。
使用这个类,创建一个新的实例,通过它的验证,Unmarshaller的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
嵌入它表明发生错误或警告。
如果从这个方法抛出unchecked异常,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.