/** * Parses the RSQL expression and returns AST. * * @param query The query expression to parse. * @return A root of the parsed AST. * * @throws RSQLParserException If some exception occurred during parsing, i.e. the * {@code query} is syntactically invalid. * @throws IllegalArgumentException If the {@code query} is <tt>null</tt>. */ public Node parse(String query) throws RSQLParserException { if (query == null) { throw new IllegalArgumentException("query must not be null"); } InputStream is = new ByteArrayInputStream(query.getBytes(ENCODING)); Parser parser = new Parser(is, ENCODING.name(), nodesFactory); try { return parser.Input(); } catch (Exception | TokenMgrError ex) { throw new RSQLParserException(ex); } } }
expressionByType.put(typeName, filterExpression); } catch (RSQLParserException e) { throw new ParseException(e.getMessage());
expressionByType.put(typeName, filterExpression); } catch (RSQLParserException e) { throw new ParseException(e.getMessage());
return ast.accept(visitor, entityType); } catch (RSQLParserException e) { throw new ParseException(e.getMessage());
/** * Parses the RSQL expression and returns AST. * * @param query The query expression to parse. * @return A root of the parsed AST. * * @throws RSQLParserException If some exception occurred during parsing, i.e. the * {@code query} is syntactically invalid. * @throws IllegalArgumentException If the {@code query} is <tt>null</tt>. */ public Node parse(String query) throws RSQLParserException { if (query == null) { throw new IllegalArgumentException("query must not be null"); } InputStream is = new ByteArrayInputStream(query.getBytes(ENCODING)); Parser parser = new Parser(is, ENCODING.name(), nodesFactory); try { return parser.Input(); } catch (Exception | TokenMgrError ex) { throw new RSQLParserException(ex); } } }
return ast.accept(visitor, entityType); } catch (RSQLParserException e) { throw new ParseException(e.getMessage());