Class JexlRuleValidator
java.lang.Object
net.simplace.core.jexl.JexlRuleValidator
Checks a rule of a solution without evaluating it, e.g. for editors (Redmine #62): the syntax is checked by
compiling the rule like
JexlRuleScript does (${component.var} replaced, expression or script
depending on JexlRuleScript.analyseComplexity(String)), the position of a syntax error is given in the
original rule, the used variables can be checked against the known ones, unknown namespaces are reported, and
hints are given for symbol operators (the SIMPLACE convention is eq ne lt le gt ge and or not) and for
rules that look like an expression but have no ${...} (they are used as plain value).- Author:
- Andreas Enders, Claude (Anthropic), co-author
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic JexlRuleValidator.ResultChecks the syntax of a rule (variables are not checked).static JexlRuleValidator.ResultChecks a rule.static JexlRuleValidator.Resultvalidate(String aRule, FWSimVarMap aVarMap) Checks a rule and its variables against a var map (e.g.
-
Method Details
-
validate
Checks the syntax of a rule (variables are not checked).- Parameters:
aRule- the rule- Returns:
- the result
-
validate
Checks a rule and its variables against a var map (e.g. the template var map of a solution).- Parameters:
aRule- the ruleaVarMap- the var map with the known variables- Returns:
- the result
-
validate
Checks a rule.- Parameters:
aRule- the ruleaKnownVariable- tells whether a variable name is known, ornullto skip the check of the variables- Returns:
- the result
-