Validate jexl expression when using jexl script before execution

39 Views Asked by At

I know if you do try catch on jexl.createScript(expressionStr) and jexl will throw error if the expression is not valid (say, missing parenthesis or not a valid close statement). Is there some library that return detailed reasons of the failure not just the location and character where the parsing fails? Or I need to write a customized one by myself?

1

There are 1 best solutions below

0
henrib On

There is currently no other method to determine if a script is syntactically valid. The exception type (Tokenization, Parsing, Ambiguous), its message and the location should indicate why it is not valid and where; if this is not the case, please provide examples.