Top Description Constructors Methods
javax.xml.bind.helpers

public Class DefaultValidationEventHandler

extends Object
implements ValidationEventHandler
Class Inheritance
All Implemented Interfaces
javax.xml.bind.ValidationEventHandler
Imports
org.w3c.dom.Node, javax.xml.bind.ValidationEvent, .ValidationEventHandler, .ValidationEventLocator, java.net.URL

JAXB 1.0 only default validation event handler. This is the default handler for all objects created from a JAXBContext that is managing schema-derived code generated by a JAXB 1.0 binding compiler.

This handler causes the unmarshal and validate operations to fail on the first error or fatal error.

This handler is not the default handler for JAXB mapped classes following JAXB 2.0 or later versions. Default validation event handling has changed and is specified in javax.xml.bind.Unmarshaller and javax.xml.bind.Marshaller.

Author
Since
1.6, JAXB 1.0
See Also
javax.xml.bind.Unmarshaller, javax.xml.bind.Validator, javax.xml.bind.ValidationEventHandler

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private String
getLocation(ValidationEvent event)

Calculate a location message for the event

public boolean
handleEvent(ValidationEvent
the encapsulated validation event information. It is a provider error if this parameter is null.
event
)

Implements javax.xml.bind.ValidationEventHandler.handleEvent.

Receive notification of a validation warning or error.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DefaultValidationEventHandlerback to summary
public DefaultValidationEventHandler()

Method Detail

getLocationback to summary
private String getLocation(ValidationEvent event)

Calculate a location message for the event

handleEventback to summary
public boolean handleEvent(ValidationEvent event)

Implements javax.xml.bind.ValidationEventHandler.handleEvent.

Doc from javax.xml.bind.ValidationEventHandler.handleEvent.

Receive notification of a validation warning or error. The ValidationEvent will have a ValidationEventLocator embedded in it that indicates where the error or warning occurred.

If an unchecked runtime exception is thrown from this method, the JAXB provider will treat it as if the method returned false and interrupt the current unmarshal, validate, or marshal operation.

Parameters
event:ValidationEvent

the encapsulated validation event information. It is a provider error if this parameter is null.

Returns:boolean

true if the JAXB Provider should attempt to continue the current unmarshal, validate, or marshal operation after handling this warning/error, false if the provider should terminate the current operation with the appropriate UnmarshalException, ValidationException, or MarshalException.