javax.xml.bind
Interface ValidationEventHandler

All Known Implementing Classes:
DefaultValidationEventHandler, ValidationEventCollector

public interface ValidationEventHandler

An instance of ValidationEventHandler allows to customize the reply to instances of ValidationEvent. By default, there is a standard ValidationEventHandler, converting errors and fatal errors in Exceptions.

The JAXB user creates instances of ValidationEventHandler and registers them with the Marshaller, Unmarshaller, or Validator. The JAXB provider is required not to throw exceptions directly, but to convert all detected problems into events, which are fired on the ValidationEventHandler.

Since:
JAXB1.0
Author:
JSR-31
See Also:
Marshaller, Unmarshaller, ValidationEvent

Method Summary
 boolean handleEvent(ValidationEvent pEvent)
          The handleEvent method is invoked by the JAXB provider, if a problem was found.
 

Method Detail

handleEvent

boolean handleEvent(ValidationEvent pEvent)

The handleEvent method is invoked by the JAXB provider, if a problem was found. The events ValidationEventLocator may be used to locate the source of the problem.

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.
Throws:
java.lang.IllegalArgumentException - The parameter is null.