javax.xml.bind.util
Class ValidationEventCollector

java.lang.Object
  extended by javax.xml.bind.util.ValidationEventCollector
All Implemented Interfaces:
ValidationEventHandler

public class ValidationEventCollector
extends java.lang.Object
implements ValidationEventHandler

Simple implementation of a ValidationEventHandler, which simply collects all the events, regardless whether they are warnings, errors, or fatal errors. You may retrieve these events at a later time using getEvents().

Since:
JAXB1.0
Author:
JSR-31

Constructor Summary
ValidationEventCollector()
          Creates a new instance of ValidationEventCollector.
 
Method Summary
 ValidationEvent[] getEvents()
          Returns the events collected so far.
 boolean handleEvent(ValidationEvent pEvent)
          Will always return true.
 boolean hasEvents()
          Returns whether any event has been collected.
 void reset()
          Clears the list of collected warnings, errors, and fatal errors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationEventCollector

public ValidationEventCollector()

Creates a new instance of ValidationEventCollector.

Method Detail

getEvents

public ValidationEvent[] getEvents()

Returns the events collected so far. Empty array, if no events have been found.


reset

public void reset()

Clears the list of collected warnings, errors, and fatal errors.


hasEvents

public boolean hasEvents()

Returns whether any event has been collected.


handleEvent

public boolean handleEvent(ValidationEvent pEvent)

Will always return true.

Specified by:
handleEvent in interface ValidationEventHandler
Parameters:
pEvent - The event being reported to the JAXB user.
Returns:
True as an indicator that the JAXB provider should attempt to continue its current operation. (Marshalling, Unmarshalling, Validating) This will not always work. In particular, you cannot expect that the operation continues, if a fatal error was reported. False to indicate that the JAXB provider should terminate the operation and through an appropriate exception.