@Test public void testImplicitConversions() { final Map<String, String> attributes = new HashMap<>(); attributes.put("A", "0123456789"); attributes.put("b", "true"); attributes.put("c", "false"); attributes.put("d", "Quick Brown Fox"); attributes.put("F", "-48"); attributes.put("n", "2014/04/04 00:00:00"); final Calendar cal = Calendar.getInstance(); cal.set(Calendar.YEAR, 2014); cal.set(Calendar.MONTH, 3); cal.set(Calendar.DAY_OF_MONTH, 4); cal.set(Calendar.HOUR, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 45); final String dateString = cal.getTime().toString(); attributes.put("z", dateString); verifyEquals("${A:plus(4)}", attributes, 123456793L); verifyEquals("${A:plus( ${F} )}", attributes, 123456741L); verifyEquals("${F:lt( ${A} )}", attributes, true); verifyEquals("${A:substring(2,3):plus(21):substring(1,2):plus(0)}", attributes, 3L); verifyEquals("${n:format( 'yyyy' )}", attributes, "2014"); verifyEquals("${z:format( 'yyyy' )}", attributes, "2014"); attributes.put("n", "2014/04/04 00:00:00.045"); verifyEquals("${n:format( 'yyyy' ):append(','):append( ${n:format( 'SSS' )} )}", attributes, "2014,045"); }
@Override public String toString() { return "Query [" + query + "]"; }
Query { @Override public String toString() { return "Query [" + query + "]"; } }
Query { @Override public String toString() { return "Query [" + query + "]"; } private  Query(final String query, final Tree tree, final Evaluator<?> evaluator); }
Query { @Override public String toString() { return "Query [" + query + "]"; } 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 { @Override public String toString() { return "Query [" + query + "]"; } 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();  }