我正在尝试在表达式字符串中使用 BigDecimal Literal
我正在使用 JEXL 2.1.1
我正在使用http://commons.apache.org/jexl/reference/syntax.html#Literals中提到的文字后缀“h”
JexlEngine expressionFactory = new JexlEngine();
JexlContext context = new MapContext();
context.set ( "a", new BigDecimal( "0.0002" ));
Expression expression = expressionFactory.createExpression(" a > 42.0h " );
boolean result=(Boolean)expression.evaluate( context );
我低于异常
org.apache.commons.jexl2.JexlException$Parsing: h@1:24 parsing error near '... , missing ...'
at org.apache.commons.jexl2.parser.JexlParser.jjtreeCloseNodeScope(JexlParser.java:126)
at org.apache.commons.jexl2.parser.Parser.ExpressionStatement(Parser.java:274)
at org.apache.commons.jexl2.parser.Parser.Statement(Parser.java:140)
at org.apache.commons.jexl2.parser.Parser.JexlScript(Parser.java:72)
at org.apache.commons.jexl2.parser.Parser.parse(Parser.java:24)
at org.apache.commons.jexl2.JexlEngine.parse(JexlEngine.java:1248)
at org.apache.commons.jexl2.JexlEngine.createExpression(JexlEngine.java:435)
at org.apache.commons.jexl2.JexlEngine.createExpression(JexlEngine.java:419)