@Test public void testIsValidExpression() { Query.validateExpression("${abc:substring(${xyz:length()})}", false); Query.isValidExpression("${now():format('yyyy-MM-dd')}"); try { Query.validateExpression("$${attr}", false); Assert.fail("invalid query validated"); } catch (final AttributeExpressionLanguageParsingException e) { } Query.validateExpression("$${attr}", true); Query.validateExpression("${filename:startsWith('T8MTXBC')\n" + ":or( ${filename:startsWith('C4QXABC')} )\n" + ":or( ${filename:startsWith('U6CXEBC')} )" + ":or( ${filename:startsWith('KYM3ABC')} )}", false); }
public static boolean isValidExpression(final String value) { try { validateExpression(value, false); return true; } catch (final AttributeExpressionLanguageParsingException | ProcessException e) { return false; } }
Query { public static boolean isValidExpression(final String value) { try { validateExpression(value, false); return true; } catch (final AttributeExpressionLanguageParsingException | ProcessException e) { return false; } } }
Query { public static boolean isValidExpression(final String value) { try { validateExpression(value, false); return true; } catch (final AttributeExpressionLanguageParsingException | ProcessException e) { return false; } } private  Query(final String query, final Tree tree, final Evaluator<?> evaluator); }
Query { public static boolean isValidExpression(final String value) { try { validateExpression(value, false); return true; } catch (final AttributeExpressionLanguageParsingException | ProcessException e) { return false; } } private  Query(final String query, final Tree tree, final Evaluator<?> evaluator); static boolean isValidExpression(final String value); static ResultType getResultType(final String value); static List<ResultType> extractResultTypes(final String value); static List<String> extractExpressions(final String value); static List<Range> extractExpressionRanges(final String value); static void validateExpression(final String value, final boolean allowSurroundingCharacters); static String unescape(final String value); static Query fromTree(final Tree tree, final String text); static Tree compileTree(final String query); static PreparedQuery prepare(final String query); static Query compile(final String query); ResultType getResultType(); @Override String toString(); }
Query { public static boolean isValidExpression(final String value) { try { validateExpression(value, false); return true; } catch (final AttributeExpressionLanguageParsingException | ProcessException e) { return false; } } private  Query(final String query, final Tree tree, final Evaluator<?> evaluator); static boolean isValidExpression(final String value); static ResultType getResultType(final String value); static List<ResultType> extractResultTypes(final String value); static List<String> extractExpressions(final String value); static List<Range> extractExpressionRanges(final String value); static void validateExpression(final String value, final boolean allowSurroundingCharacters); static String unescape(final String value); static Query fromTree(final Tree tree, final String text); static Tree compileTree(final String query); static PreparedQuery prepare(final String query); static Query compile(final String query); ResultType getResultType(); @Override String toString();  }