Supports expressions like:
1+2
- outputs double(1+2)
- outputs double1+2*41
- outputs double1+2*4-51
- outputs double1 + 2 * ( 2 - 3) / 41
- outputs double(1+2+3)*41
- outputs double10/(1+2*3)*41
- outputs double2021-11-28T14:50:45 + 1 day
- outputs LocalDateTime2021-11-28T14:50:45 - 1 day
- outputs LocalDateTime2021-11-28T14:50:45 unixtime
- outputs LocalDateTimestr1 + str2
- outputs Stringstr1 + 21
- outputs String1 + str2
- outputs String
Lookup values are also supported. For example:
ExpressionParser.buildDefault()
.compile("1 + $param1")
.eval(new ExpressionAlgoContext(o -> {
if ("param1".equals(o)) {
return 2;
}
return null;
}));