Top Description Constructors Methods
jakarta.xml.bind.helpers

public Class DefaultValidationEventHandler

extends Object
implements ValidationEventHandler
Class Inheritance
All Implemented Interfaces
jakarta.xml.bind.ValidationEventHandler
Imports
org.w3c.dom.Node, jakarta.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 Jakarta XML Binding mapped classes following Jakarta XML Binding or later versions. Default validation event handling has changed and is specified in jakarta.xml.bind.Unmarshaller and jakarta.xml.bind.Marshaller.

Author
Since
1.6, JAXB 1.0
See Also
jakarta.xml.bind.Unmarshaller, jakarta.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 jakarta.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 jakarta.xml.bind.ValidationEventHandler.handleEvent.

Doc from jakarta.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 Jakarta XML Binding 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 Jakarta XML Binding 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.

Annotations
@Override