// set up error handler to catch validation errors\
ParseErrorHandler errorHandler = new ParseErrorHandler();
reader.setErrorHandler(errorHandler);
// Parse with SaxDeserializer
SaxDeserializer deser = new SaxDeserializer_impl(this, aOptions);
reader.setContentHandler(deser);
reader.parse(input);
// if there was an exception, throw it
if (errorHandler.getException() != null) {
throw errorHandler.getException();
}
// otherwise build the UIMA XMLizable object and return it
XMLizable result = deser.getObject();
if (result instanceof MetaDataObject_impl) {
// set Source URL (needed to later resolve descriptor-relative paths)
((MetaDataObject_impl) result).setSourceUrl(urlToParse);
}