private void reportError(String msg, Exception nested, boolean canRecover) throws SAXException { context.handleEvent( new ValidationEventImpl( canRecover ? ValidationEvent.ERROR : ValidationEvent.FATAL_ERROR, msg, new ValidationEventLocatorImpl(context.getLocator()), nested), canRecover); }
public static void reportError(String msg, Exception nested, boolean canRecover) throws SAXException { UnmarshallingContext context = UnmarshallingContext.getInstance(); context.handleEvent( new ValidationEventImpl( canRecover ? ValidationEvent.ERROR : ValidationEvent.FATAL_ERROR, msg, context.getLocator().getLocation(), nested), canRecover); }
/** * This method is called by the generated derived class when a datatype parse method throws an * exception. */ protected void handleParseConversionException(Exception e) throws SAXException { if (e instanceof RuntimeException) throw (RuntimeException) e; // don't catch the runtime exception. just let it go. // wrap it into a ParseConversionEvent and report it ParseConversionEvent pce = new ParseConversionEventImpl( ValidationEvent.ERROR, e.getMessage(), new ValidationEventLocatorImpl(context.getLocator()), e); context.handleEvent(pce, true); }
public State(UnmarshallingContext context) throws SAXException { result = dom.createUnmarshaller(context); handler.setResult(result); // emulate the start of documents try { handler.setDocumentLocator(context.getLocator()); handler.startDocument(); declarePrefixes(context, context.getAllDeclaredPrefixes()); } catch (SAXException e) { context.handleError(e); throw e; } }