private void processError() throws IOException, QueryResultParseException { byte errTypeFlag = in.readByte(); QueryErrorType errType = null; if (errTypeFlag == MALFORMED_QUERY_ERROR) { errType = QueryErrorType.MALFORMED_QUERY_ERROR; } else if (errTypeFlag == QUERY_EVALUATION_ERROR) { errType = QueryErrorType.QUERY_EVALUATION_ERROR; } else { throw new QueryResultParseException("Unkown error type: " + errTypeFlag); } String msg = readString(); // FIXME: is this the right thing to do upon encountering an error? throw new QueryResultParseException(errType + ": " + msg); }
private void processError() throws IOException, QueryResultParseException { byte errTypeFlag = in.readByte(); QueryErrorType errType = null; if (errTypeFlag == MALFORMED_QUERY_ERROR) { errType = QueryErrorType.MALFORMED_QUERY_ERROR; } else if (errTypeFlag == QUERY_EVALUATION_ERROR) { errType = QueryErrorType.QUERY_EVALUATION_ERROR; } else { throw new QueryResultParseException("Unkown error type: " + errTypeFlag); } String msg = readString(); // FIXME: is this the right thing to do upon encountering an error? throw new QueryResultParseException(errType + ": " + msg); }
private void processError() throws IOException, QueryResultParseException { byte errTypeFlag = in.readByte(); QueryErrorType errType = null; if (errTypeFlag == MALFORMED_QUERY_ERROR) { errType = QueryErrorType.MALFORMED_QUERY_ERROR; } else if (errTypeFlag == QUERY_EVALUATION_ERROR) { errType = QueryErrorType.QUERY_EVALUATION_ERROR; } else { throw new QueryResultParseException("Unkown error type: " + errTypeFlag); } String msg = readString(); // FIXME: is this the right thing to do upon encountering an error? throw new QueryResultParseException(errType + ": " + msg); }
@Override public synchronized void parseQueryResult(InputStream in) throws IOException, QueryResultParseException { try { parseQueryResultInternal(in, true, false); } catch (QueryResultHandlerException e) { throw new QueryResultParseException(e); } }
@Override public synchronized void parseQueryResult(InputStream in) throws IOException, QueryResultParseException { try { parseQueryResultInternal(in, true, false); } catch (QueryResultHandlerException e) { throw new QueryResultParseException(e); } }
@Override @Deprecated public boolean parse(InputStream in) throws IOException, QueryResultParseException { try { return parseQueryResultInternal(in, true, false); } catch (QueryResultHandlerException e) { throw new QueryResultParseException(e); } }
@Override @Deprecated public boolean parse(InputStream in) throws IOException, QueryResultParseException { try { return parseQueryResultInternal(in, true, false); } catch (QueryResultHandlerException e) { throw new QueryResultParseException(e); } }
@Override public synchronized void parseQueryResult(InputStream in) throws IOException, QueryResultParseException { try { parseQueryResultInternal(in, true, false); } catch (QueryResultHandlerException e) { throw new QueryResultParseException(e); } }
@Override @Deprecated public boolean parse(InputStream in) throws IOException, QueryResultParseException { try { return parseQueryResultInternal(in, true, false); } catch (QueryResultHandlerException e) { throw new QueryResultParseException(e); } } }
@Override @Deprecated public boolean parse(InputStream in) throws IOException, QueryResultParseException { try { return parseQueryResultInternal(in, true, false); } catch (QueryResultHandlerException e) { throw new QueryResultParseException(e); } } }
@Override @Deprecated public boolean parse(InputStream in) throws IOException, QueryResultParseException { try { return parseQueryResultInternal(in, true, false); } catch (QueryResultHandlerException e) { throw new QueryResultParseException(e); } } }
@Override public void startTag(String tagName, Map<String, String> atts, String text) throws SAXException { if (BOOLEAN_TAG.equals(tagName)) { if (BOOLEAN_TRUE.equalsIgnoreCase(text)) { value = true; } else if (BOOLEAN_FALSE.equalsIgnoreCase(text)) { value = false; } else { throw new SAXException("Illegal value for element " + BOOLEAN_TAG + ": " + text); } } else if (RESULT_SET_TAG.equals(tagName) || RESULT_TAG.equals(tagName)) { QueryResultParseException realException = new QueryResultParseException( "Found tuple results in boolean parser"); throw new SAXException(realException); } }
@Override public void startTag(String tagName, Map<String, String> atts, String text) throws SAXException { if (BOOLEAN_TAG.equals(tagName)) { if (BOOLEAN_TRUE.equalsIgnoreCase(text)) { value = true; } else if (BOOLEAN_FALSE.equalsIgnoreCase(text)) { value = false; } else { throw new SAXException("Illegal value for element " + BOOLEAN_TAG + ": " + text); } } else if (RESULT_SET_TAG.equals(tagName) || RESULT_TAG.equals(tagName)) { QueryResultParseException realException = new QueryResultParseException( "Found tuple results in boolean parser"); throw new SAXException(realException); } }
@Override public void startTag(String tagName, Map<String, String> atts, String text) throws SAXException { if (BOOLEAN_TAG.equals(tagName)) { if (BOOLEAN_TRUE.equalsIgnoreCase(text)) { value = true; } else if (BOOLEAN_FALSE.equalsIgnoreCase(text)) { value = false; } else { throw new SAXException("Illegal value for element " + BOOLEAN_TAG + ": " + text); } } else if (RESULT_SET_TAG.equals(tagName) || RESULT_TAG.equals(tagName)) { QueryResultParseException realException = new QueryResultParseException( "Found tuple results in boolean parser"); throw new SAXException(realException); } }
@Override public void fatalError(SAXParseException exception) throws SAXException { if (getParseErrorListener() != null) { getParseErrorListener().fatalError(exception.getMessage(), internalSAXParser.getLocator().getLineNumber(), internalSAXParser.getLocator().getColumnNumber()); } throw new SAXParseException(exception.getMessage(), internalSAXParser.getLocator(), new QueryResultParseException(exception, internalSAXParser.getLocator().getLineNumber(), internalSAXParser.getLocator().getColumnNumber())); }
@Override public void fatalError(SAXParseException exception) throws SAXException { if (getParseErrorListener() != null) { getParseErrorListener().fatalError(exception.getMessage(), internalSAXParser.getLocator().getLineNumber(), internalSAXParser.getLocator().getColumnNumber()); } throw new SAXParseException(exception.getMessage(), internalSAXParser.getLocator(), new QueryResultParseException(exception, internalSAXParser.getLocator().getLineNumber(), internalSAXParser.getLocator().getColumnNumber())); }
@Override public void fatalError(SAXParseException exception) throws SAXException { if (getParseErrorListener() != null) { getParseErrorListener().fatalError(exception.getMessage(), internalSAXParser.getLocator().getLineNumber(), internalSAXParser.getLocator().getColumnNumber()); } throw new SAXParseException(exception.getMessage(), internalSAXParser.getLocator(), new QueryResultParseException(exception, internalSAXParser.getLocator().getLineNumber(), internalSAXParser.getLocator().getColumnNumber())); }
@Override public void error(SAXParseException exception) throws SAXException { try { if (getParserConfig().get(XMLParserSettings.FAIL_ON_SAX_NON_FATAL_ERRORS)) { if (getParseErrorListener() != null) { getParseErrorListener().error(exception.getMessage(), internalSAXParser.getLocator().getLineNumber(), internalSAXParser.getLocator().getColumnNumber()); } if (!getParserConfig().isNonFatalError(XMLParserSettings.FAIL_ON_SAX_NON_FATAL_ERRORS)) { throw new QueryResultParseException(exception, internalSAXParser.getLocator().getLineNumber(), internalSAXParser.getLocator().getColumnNumber()); } } } catch (QueryResultParseException e) { throw new SAXException(e); } }
@Override public void error(SAXParseException exception) throws SAXException { try { if (getParserConfig().get(XMLParserSettings.FAIL_ON_SAX_NON_FATAL_ERRORS)) { if (getParseErrorListener() != null) { getParseErrorListener().error(exception.getMessage(), internalSAXParser.getLocator().getLineNumber(), internalSAXParser.getLocator().getColumnNumber()); } if (!getParserConfig().isNonFatalError(XMLParserSettings.FAIL_ON_SAX_NON_FATAL_ERRORS)) { throw new QueryResultParseException(exception, internalSAXParser.getLocator().getLineNumber(), internalSAXParser.getLocator().getColumnNumber()); } } } catch (QueryResultParseException e) { throw new SAXException(e); } }
@Override public void error(SAXParseException exception) throws SAXException { try { if (getParserConfig().get(XMLParserSettings.FAIL_ON_SAX_NON_FATAL_ERRORS)) { if (getParseErrorListener() != null) { getParseErrorListener().error(exception.getMessage(), internalSAXParser.getLocator().getLineNumber(), internalSAXParser.getLocator().getColumnNumber()); } if (!getParserConfig().isNonFatalError(XMLParserSettings.FAIL_ON_SAX_NON_FATAL_ERRORS)) { throw new QueryResultParseException(exception, internalSAXParser.getLocator().getLineNumber(), internalSAXParser.getLocator().getColumnNumber()); } } } catch (QueryResultParseException e) { throw new SAXException(e); } }