ValidationEventImplpublic class ValidationEventImpl extends Object implements ValidationEventDefault 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. |
Fields Summary |
---|
private int | severity | private String | message | private Throwable | linkedException | private ValidationEventLocator | locator |
Constructors Summary |
---|
public ValidationEventImpl(int _severity, String _message, ValidationEventLocator _locator)Create a new ValidationEventImpl.
this(_severity,_message,_locator,null);
| public ValidationEventImpl(int _severity, String _message, ValidationEventLocator _locator, Throwable _linkedException)Create a new ValidationEventImpl.
setSeverity( _severity );
this.message = _message;
this.locator = _locator;
this.linkedException = _linkedException;
|
Methods Summary |
---|
public java.lang.Throwable | getLinkedException()
return linkedException;
| public javax.xml.bind.ValidationEventLocator | getLocator()
return locator;
| public java.lang.String | getMessage()
return message;
| public int | getSeverity()
return severity;
| public void | setLinkedException(java.lang.Throwable _linkedException)Set the linked exception field of this event.
this.linkedException = _linkedException;
| public void | setLocator(javax.xml.bind.ValidationEventLocator _locator)Set the locator object for this event.
this.locator = _locator;
| public void | setMessage(java.lang.String _message)Set the message field of this event.
this.message = _message;
| public void | setSeverity(int _severity)Set the severity field of this event.
if( _severity != ValidationEvent.WARNING &&
_severity != ValidationEvent.ERROR &&
_severity != ValidationEvent.FATAL_ERROR ) {
throw new IllegalArgumentException(
Messages.format( Messages.ILLEGAL_SEVERITY ) );
}
this.severity = _severity;
| public java.lang.String | toString()Returns a string representation of this object in a format
helpful to debugging.
String s;
switch(getSeverity()) {
case WARNING: s="WARNING";break;
case ERROR: s="ERROR";break;
case FATAL_ERROR: s="FATAL_ERROR";break;
default: s=String.valueOf(getSeverity());break;
}
return MessageFormat.format("[severity={0},message={1},locator={2}]",
new Object[]{
s,
getMessage(),
getLocator()
});
|
|