Top Description Fields Constructors Methods
javax.xml.bind.helpers

public Class ValidationEventImpl

extends Object
implements ValidationEvent
Class Inheritance
All Implemented Interfaces
javax.xml.bind.ValidationEvent
Known Direct Subclasses
javax.xml.bind.helpers.NotIdentifiableEventImpl, javax.xml.bind.helpers.ParseConversionEventImpl, javax.xml.bind.helpers.PrintConversionEventImpl
Imports
java.text.MessageFormat, javax.xml.bind.ValidationEvent, .ValidationEventLocator

Default implementation of the ValidationEvent interface.

JAXB providers are allowed to use whatever class that implements the ValidationEvent interface. This class is just provided for a convenience.

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

Field Summary

Modifier and TypeField and Description
private Throwable
private ValidationEventLocator
private String
private int

Constructor Summary

AccessConstructor and Description
public
ValidationEventImpl(int
The severity value for this event. Must be one of ValidationEvent.WARNING, ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR
_severity
,
String
The text message for this event - may be null.
_message
,
ValidationEventLocator
The locator object for this event - may be null.
_locator
)

Create a new ValidationEventImpl.

public
ValidationEventImpl(int
The severity value for this event. Must be one of ValidationEvent.WARNING, ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR
_severity
,
String
The text message for this event - may be null.
_message
,
ValidationEventLocator
The locator object for this event - may be null.
_locator
,
Throwable
An optional linked exception that may provide additional information about the event - may be null.
_linkedException
)

Create a new ValidationEventImpl.

Method Summary

Modifier and TypeMethod and Description
public Throwable
getLinkedException()

Implements javax.xml.bind.ValidationEvent.getLinkedException.

Retrieve the linked exception for this warning/error.
public ValidationEventLocator
getLocator()

Implements javax.xml.bind.ValidationEvent.getLocator.

Retrieve the locator for this warning/error.
public String
getMessage()

Implements javax.xml.bind.ValidationEvent.getMessage.

Retrieve the text message for this warning/error.
public int
getSeverity()

Implements javax.xml.bind.ValidationEvent.getSeverity.

Retrieve the severity code for this warning/error.
public void
setLinkedException(Throwable
Optional linked exception - may be null.
_linkedException
)

Set the linked exception field of this event.

public void
setLocator(ValidationEventLocator
The locator - may be null.
_locator
)

Set the locator object for this event.

public void
setMessage(String
String message - may be null.
_message
)

Set the message field of this event.

public void
setSeverity(int
Must be one of ValidationEvent.WARNING, ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR.
_severity
)

Set the severity field of this event.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of this object in a format helpful to debugging.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

linkedExceptionback to summary
private Throwable linkedException
locatorback to summary
private ValidationEventLocator locator
messageback to summary
private String message
severityback to summary
private int severity

Constructor Detail

ValidationEventImplback to summary
public ValidationEventImpl(int _severity, String _message, ValidationEventLocator _locator)

Create a new ValidationEventImpl.

Parameters
_severity:int

The severity value for this event. Must be one of ValidationEvent.WARNING, ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR

_message:String

The text message for this event - may be null.

_locator:ValidationEventLocator

The locator object for this event - may be null.

Exceptions
IllegalArgumentException:
if an illegal severity field is supplied
ValidationEventImplback to summary
public ValidationEventImpl(int _severity, String _message, ValidationEventLocator _locator, Throwable _linkedException)

Create a new ValidationEventImpl.

Parameters
_severity:int

The severity value for this event. Must be one of ValidationEvent.WARNING, ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR

_message:String

The text message for this event - may be null.

_locator:ValidationEventLocator

The locator object for this event - may be null.

_linkedException:Throwable

An optional linked exception that may provide additional information about the event - may be null.

Exceptions
IllegalArgumentException:
if an illegal severity field is supplied

Method Detail

getLinkedExceptionback to summary
public Throwable getLinkedException()

Implements javax.xml.bind.ValidationEvent.getLinkedException.

Doc from javax.xml.bind.ValidationEvent.getLinkedException.

Retrieve the linked exception for this warning/error.

Returns:Throwable

the linked exception for this warning/error or null if one wasn't set

getLocatorback to summary
public ValidationEventLocator getLocator()

Implements javax.xml.bind.ValidationEvent.getLocator.

Doc from javax.xml.bind.ValidationEvent.getLocator.

Retrieve the locator for this warning/error.

Returns:ValidationEventLocator

the locator that indicates where the warning/error occurred

getMessageback to summary
public String getMessage()

Implements javax.xml.bind.ValidationEvent.getMessage.

Doc from javax.xml.bind.ValidationEvent.getMessage.

Retrieve the text message for this warning/error.

Returns:String

the text message for this warning/error or null if one wasn't set

getSeverityback to summary
public int getSeverity()

Implements javax.xml.bind.ValidationEvent.getSeverity.

Doc from javax.xml.bind.ValidationEvent.getSeverity.

Retrieve the severity code for this warning/error.

Must be one of ValidationEvent.WARNING, ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR.

Returns:int

the severity code for this warning/error

setLinkedExceptionback to summary
public void setLinkedException(Throwable _linkedException)

Set the linked exception field of this event.

Parameters
_linkedException:Throwable

Optional linked exception - may be null.

setLocatorback to summary
public void setLocator(ValidationEventLocator _locator)

Set the locator object for this event.

Parameters
_locator:ValidationEventLocator

The locator - may be null.

setMessageback to summary
public void setMessage(String _message)

Set the message field of this event.

Parameters
_message:String

String message - may be null.

setSeverityback to summary
public void setSeverity(int _severity)

Set the severity field of this event.

Parameters
_severity:int

Must be one of ValidationEvent.WARNING, ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR.

Exceptions
IllegalArgumentException:
if an illegal severity field is supplied
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this object in a format helpful to debugging.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object.

See Also
Object#equals(Object)