Refine search
/** * Forward notification of a fatal parsing error to the application * supplied error handler (if any). * * @param exception The fatal error information * * @exception SAXException if a parsing exception occurs */ @Override public void fatalError(SAXParseException exception) throws SAXException { log.error("Parse Fatal Error at line " + exception.getLineNumber() + " column " + exception.getColumnNumber() + ": " + exception.getMessage(), exception); if (errorHandler != null) { errorHandler.fatalError(exception); } }
/** * Forward notification of a parsing error to the application supplied * error handler (if any). * * @param exception The error information * * @exception SAXException if a parsing exception occurs */ @Override public void error(SAXParseException exception) throws SAXException { log.error("Parse Error at line " + exception.getLineNumber() + " column " + exception.getColumnNumber() + ": " + exception.getMessage(), exception); if (errorHandler != null) { errorHandler.error(exception); } }
/** * Forward notification of a parse warning to the application supplied * error handler (if any). * * @param exception The warning information * * @exception SAXException if a parsing exception occurs */ @Override public void warning(SAXParseException exception) throws SAXException { if (errorHandler != null) { log.warn("Parse Warning Error at line " + exception.getLineNumber() + " column " + exception.getColumnNumber() + ": " + exception.getMessage(), exception); errorHandler.warning(exception); } }
public void parse() throws SAXException { // parses a content object by using the given marshaller // SAX events will be sent to the repeater, and the repeater // will further forward it to an appropriate component. try { marshaller.marshal( contentObject, (XMLFilterImpl)repeater ); } catch( JAXBException e ) { // wrap it to a SAXException SAXParseException se = new SAXParseException( e.getMessage(), null, null, -1, -1, e ); // if the consumer sets an error handler, it is our responsibility // to notify it. if(errorHandler!=null) errorHandler.fatalError(se); // this is a fatal error. Even if the error handler // returns, we will abort anyway. throw se; } } };
public void parse(InputSource source) throws SAXException, IOException systemId = source.getSystemId(); if(systemId == null) { SAXParseException saxException = new SAXParseException( "null source systemId" , this); errorHandler.fatalError(saxException); return; stream = new FileInputStream(systemId); } catch (FileNotFoundException fnfe) { final SAXParseException saxException = new SAXParseException( "could not open file with systemId "+systemId, this, fnfe); errorHandler.fatalError(saxException); return; errorHandler.fatalError(saxException); return; "expected start tag not"+pp.getPositionDescription(), this); errorHandler.fatalError(saxException); return; "parsing initialization error: "+ex, this, ex); errorHandler.fatalError(saxException); return;
String qualifiedName = null; DocumentType doctype = null; String inputEncoding = source.getEncoding(); String systemId = source.getSystemId(); DocumentImpl document = new DocumentImpl( dom, namespaceURI, qualifiedName, doctype, inputEncoding); parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, namespaceAware); if (source.getByteStream() != null) { parser.setInput(source.getByteStream(), inputEncoding); } else if (source.getCharacterStream() != null) { throw new SAXParseException("InputSource needs a stream, reader or URI", null); throw new SAXParseException("Unexpected end of document", null); locator.setColumnNumber(ex.getColumnNumber()); SAXParseException newEx = new SAXParseException(ex.getMessage(), locator); errorHandler.error(newEx);
if (errorHandler != null) { try { errorHandler.error(new SAXParseException( exception.getMessage(), null, exception));
/** * @param string * @throws SAXException */ private void warn(String message) throws SAXException { if (errorHandler != null) { SAXParseException spe = new SAXParseException(message, this); errorHandler.warning(spe); } }
public void error(SAXParseException ex) throws SAXException { ErrorHandler eh = getErrorHandler(); if (eh != null) { eh.error(ex); } else { log.error(message(ex.getMessage(), _loc)); throw ex; } } public void fatalError(SAXParseException ex) throws SAXException {
public void warning(SAXParseException ex) throws SAXException { ErrorHandler eh = getErrorHandler(); if (eh != null) { eh.warning(ex); } else { log.warn(message(ex.getMessage(), _loc)); } } public void error(SAXParseException ex) throws SAXException {
public void fatalError (SAXParseException exception) throws SAXException { core.fatalError(exception); } }
/** * Filter a warning event. * * @param e The warning as an exception. * @exception org.xml.sax.SAXException The client may throw * an exception during processing. */ public void warning (SAXParseException e) throws SAXException { if (errorHandler != null) { errorHandler.warning(e); } }
private void reportException(String message,SAXException ex, ErrorHandler errorHandler,boolean reportAsError) throws SAXException { SAXParseException exception= new SAXParseException(message, locator); exception.initCause(ex); if (reportAsError){ errorHandler.error(exception); } else{ errorHandler.warning(exception); } }
public void warning(SAXParseException exception) throws SAXException { if(null!=clientErrorHandler) clientErrorHandler.error(exception); }
private void parse() throws SAXException { SAXResult result = new SAXResult(getContentHandler()); result.setLexicalHandler(getLexicalHandler()); try { this.marshaller.marshal(this.content, result); } catch (IOException ex) { SAXParseException saxException = new SAXParseException(ex.getMessage(), null, null, -1, -1, ex); ErrorHandler errorHandler = getErrorHandler(); if (errorHandler != null) { errorHandler.fatalError(saxException); } else { throw saxException; } } } }
@Override protected void errNoNamedCharacterMatch() throws SAXException { if (errorHandler == null) { return; } SAXParseException spe = new SAXParseException( "\u201C&\u201D did not start a character reference. (\u201C&\u201D probably should have been escaped as \u201C&\u201D.)", ampersandLocation); errorHandler.error(spe); }
void warn(String message) throws SAXException { SAXParseException err; err = new SAXParseException(message, this); errorHandler.warning(err); }
/** * Filter a fatal error event. * * @param e The error as an exception. * @exception org.xml.sax.SAXException The client may throw * an exception during processing. */ public void fatalError (SAXParseException e) throws SAXException { if (errorHandler != null) { errorHandler.fatalError(e); } }
public void warning (SAXParseException exception) throws SAXException { core.warning(exception); }
public void error(SAXParseException exception) throws SAXException { if(null!=clientErrorHandler) clientErrorHandler.error(exception); }