[ https://issues.apache.org/jira/browse/JEXL-297?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henri Biestro resolved JEXL-297. -------------------------------- Resolution: Not A Problem Poster has not updated/responded for a month, considering solution was provided. > validate expression (instead of evaluate) > ----------------------------------------- > > Key: JEXL-297 > URL: https://issues.apache.org/jira/browse/JEXL-297 > Project: Commons JEXL > Issue Type: New Feature > Affects Versions: 3.1 > Reporter: Sharon Ben Asher > Priority: Minor > > My project uses JEXL to both validate and evaluate expressions. > Let me explain: > The product has an excel-like feature and two stages: > In the "design" stage, a user may enter a literal OR a formula in input > fields. fields are either numeric-typed or boolean-typed, so an expression > may be numeric or boolean. the expressions may contain variables. In the > "production" stage, the expressions are evaluated. variables get values from > the DB. > During the design, we are validating the expressions and alert the user if > there are syntax errors. at that time, validation is using JEXL to evaluate > the expression and examines the result for exceptions or error responses. the > variables are assigned some default value. > The problem I am having is to come up with default values that will not cause > errors not related to syntax (like division by zero) I am encountering all > kinds of arithmetic exceptions that are because of values and not because of > syntax. > So perhaps JEXL can support "syntax validation" feature, where variables can > be "any value that is valid at this position" -- This message was sent by Atlassian JIRA (v7.6.3#76005)