javax.xml.bind
Interface ValidationEventHandler
- 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
.
handleEvent
public 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.
pEvent
- The event being reported to the JAXB user.
- 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.