@Test public void testEvaluate_InvalidExpression () { try { mEvaluator.evaluate ("?'abc", new ScopeImpl (null)); fail ("no exception"); } catch (ExecutionException ee) { assertTrue (ee.getMessage ().contains ("invalid expression")); } }
public EvaluatedExpression evaluate (String expression, Scope scope) { try { mLexer.setCharStream (new ANTLRStringStream (expression)); mParser.setTokenStream (new CommonTokenStream (mLexer)); CommonTree tree = (CommonTree) mParser.root ().getTree (); mWalker.setTreeNodeStream (new CommonTreeNodeStream (tree)); return mWalker.main (scope); } catch (RecognitionException re) { throw new ExecutionException ("invalid expression '%s'", expression); } }
ExpressionEvaluator { public EvaluatedExpression evaluate (String expression, Scope scope) { try { mLexer.setCharStream (new ANTLRStringStream (expression)); mParser.setTokenStream (new CommonTokenStream (mLexer)); CommonTree tree = (CommonTree) mParser.root ().getTree (); mWalker.setTreeNodeStream (new CommonTreeNodeStream (tree)); return mWalker.main (scope); } catch (RecognitionException re) { throw new ExecutionException ("invalid expression '%s'", expression); } } }
ExpressionEvaluator { public EvaluatedExpression evaluate (String expression, Scope scope) { try { mLexer.setCharStream (new ANTLRStringStream (expression)); mParser.setTokenStream (new CommonTokenStream (mLexer)); CommonTree tree = (CommonTree) mParser.root ().getTree (); mWalker.setTreeNodeStream (new CommonTreeNodeStream (tree)); return mWalker.main (scope); } catch (RecognitionException re) { throw new ExecutionException ("invalid expression '%s'", expression); } } ExpressionEvaluator(Functions functions); }
ExpressionEvaluator { public EvaluatedExpression evaluate (String expression, Scope scope) { try { mLexer.setCharStream (new ANTLRStringStream (expression)); mParser.setTokenStream (new CommonTokenStream (mLexer)); CommonTree tree = (CommonTree) mParser.root ().getTree (); mWalker.setTreeNodeStream (new CommonTreeNodeStream (tree)); return mWalker.main (scope); } catch (RecognitionException re) { throw new ExecutionException ("invalid expression '%s'", expression); } } ExpressionEvaluator(Functions functions); static void setBusinessDayChecker(BusinessDayChecker checker); static BusinessDayChecker getBusinessDayChecker(); EvaluatedExpression evaluate(String expression, Scope scope); }
ExpressionEvaluator { public EvaluatedExpression evaluate (String expression, Scope scope) { try { mLexer.setCharStream (new ANTLRStringStream (expression)); mParser.setTokenStream (new CommonTokenStream (mLexer)); CommonTree tree = (CommonTree) mParser.root ().getTree (); mWalker.setTreeNodeStream (new CommonTreeNodeStream (tree)); return mWalker.main (scope); } catch (RecognitionException re) { throw new ExecutionException ("invalid expression '%s'", expression); } } ExpressionEvaluator(Functions functions); static void setBusinessDayChecker(BusinessDayChecker checker); static BusinessDayChecker getBusinessDayChecker(); EvaluatedExpression evaluate(String expression, Scope scope);  }