}
protected void validationEvent(int pSeverity, String pMsg, String pErrorCode,
Exception pException)
throws SAXException {
ValidationEventHandler eventHandler;
try {
eventHandler = getData().getUnmarshaller().getEventHandler();
} catch (JAXBException e) {
/* Interesting question: Which event to report? The JAXBException or the
* validation event? We decide against the former.
*/
throw new SAXException(e);
}
if (eventHandler == null) {
throw new SAXParseException(pMsg, getDocumentLocator(), pException);
} else {
ValidationEventLocator myLocator = new ValidationEventLocatorImpl(getDocumentLocator());
ValidationEventImpl event = new ValidationEventImpl(pSeverity,
pErrorCode + ": " + pMsg,
myLocator,
pException);
event.setErrorCode(pErrorCode);
eventHandler.handleEvent(event);
}
}