Package org.idempiere.expression.logic
Class LogicEvaluator
java.lang.Object
org.idempiere.expression.logic.LogicEvaluator
Static method for evaluation of logic expression
- Author:
- hengsin
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
evaluateLogic
(Evaluatee source, String logic) Evaluate Logic Expression.static void
Throw exception if logic expression is not valid
-
Method Details
-
evaluateLogic
Evaluate Logic Expression.
format: <negate>(<expression> [<logic> <expression>]). <negate>: $!. <expression>: @<context>@<comparison><value>. <logic>: | or & (Example '@AD_Table@=Test | @Language@=GERGER). <comparison>: = | ! | ^ | < | > | <= | >= | ~ (Equal, Not Equal, Not Equal, Less Than, Greater Than, Less Than or Equal, Greater Than or Equal, Regular Expression Match). <Regular Expression Match>: <input string> ~ '<regular expression>'. <List>: value1,value2,value3 (Example '@CalculationType@=A,R,S'). <context>: any global or window context. <value>: strings can be with ' or ". <logic operators>: AND or OR with the previous result from left to right. <()>: override the default left to right evaluation order (Example '@GrandTotal@=0 |(@GrandTotal@>0 & @PaymentRule@=X)").
- Parameters:
source
- class implementing get_ValueAsString(variable)logic
- logic expression- Returns:
- logic evaluation result
-
validate
Throw exception if logic expression is not valid- Parameters:
logic
-- Throws:
org.antlr.v4.runtime.misc.ParseCancellationException
-