/** * INTERNAL * Add the exception to the list of errors. */ public void addError(Exception e) { if (e instanceof RecognitionException) { e = handleRecognitionException((RecognitionException)e); } else if (!(e instanceof JPQLException)) { e = JPQLException.generalParsingException(getQueryInfo(), e); } errors.add(e); }
/** * INTERNAL * Add the exception to the list of errors. */ public void addError(Exception e) { if (e instanceof RecognitionException) { e = handleRecognitionException((RecognitionException)e); } else if (!(e instanceof JPQLException)) { e = JPQLException.generalParsingException(getQueryInfo(), e); } errors.add(e); }
/** * INTERNAL * Add the exception to the list of errors. */ public void addError(Exception e) { if (e instanceof RecognitionException) { e = handleRecognitionException((RecognitionException)e); } else if (!(e instanceof JPQLException)) { e = JPQLException.generalParsingException(getQueryInfo(), e); } errors.add(e); }
/** * INTERNAL * Generate an exception which encapsulates all the exceptions generated * by this parser. Special case where the first exception is an * JPQLException. */ protected JPQLException generateException() { //Handle exceptions we expect (such as expressionSotSupported) Exception firstException = (Exception)getErrors().get(0); if (firstException instanceof JPQLException) { return (JPQLException)firstException; } //Handle general exceptions, such as NPE JPQLException exception = JPQLException.generalParsingException(getQueryInfo()); exception.setInternalExceptions(getErrors()); return exception; }
/** * INTERNAL * Generate an exception which encapsulates all the exceptions generated * by this parser. Special case where the first exception is an * JPQLException. */ protected JPQLException generateException() { //Handle exceptions we expect (such as expressionSotSupported) Exception firstException = (Exception)getErrors().get(0); if (firstException instanceof JPQLException) { return (JPQLException)firstException; } //Handle general exceptions, such as NPE JPQLException exception = JPQLException.generalParsingException(getQueryInfo()); exception.setInternalExceptions(getErrors()); return exception; }
/** * INTERNAL * Generate an exception which encapsulates all the exceptions generated * by this parser. Special case where the first exception is an * JPQLException. */ protected JPQLException generateException() { //Handle exceptions we expect (such as expressionSotSupported) Exception firstException = (Exception)getErrors().get(0); if (firstException instanceof JPQLException) { return (JPQLException)firstException; } //Handle general exceptions, such as NPE JPQLException exception = JPQLException.generalParsingException(getQueryInfo()); exception.setInternalExceptions(getErrors()); return exception; }
/** * INTERNAL * Creates a parser for the specified query string. The query string is * not parsed (see method parse). */ public static JPQLParser buildParserFor(String queryName, String queryText) throws JPQLException { try { JPQLParser parser = JPQLParserBuilder.buildParser(queryText); parser.setQueryName(queryName); parser.setQueryText(queryText); parser.setNodeFactory(new NodeFactoryImpl(parser.getQueryInfo())); return parser; } catch (Exception ex) { throw JPQLException.generalParsingException(queryText, ex); } }
/** * INTERNAL * Creates a parser for the specified query string. The query string is * not parsed (see method parse). */ public static JPQLParser buildParserFor(String queryName, String queryText) throws JPQLException { try { JPQLParser parser = JPQLParserBuilder.buildParser(queryText); parser.setQueryName(queryName); parser.setQueryText(queryText); parser.setNodeFactory(new NodeFactoryImpl(parser.getQueryInfo())); return parser; } catch (Exception ex) { throw JPQLException.generalParsingException(queryText, ex); } }
/** * INTERNAL * Creates a parser for the specified query string. The query string is * not parsed (see method parse). */ public static JPQLParser buildParserFor(String queryName, String queryText) throws JPQLException { try { JPQLParser parser = JPQLParserBuilder.buildParser(queryText); parser.setQueryName(queryName); parser.setQueryText(queryText); parser.setNodeFactory(new NodeFactoryImpl(parser.getQueryInfo())); return parser; } catch (Exception ex) { throw JPQLException.generalParsingException(queryText, ex); } }