Class LogicEvaluator


  • public final class LogicEvaluator
    extends Object
    Author:
    hengsin
    • Method Detail

      • evaluateLogic

        public static boolean evaluateLogic​(Evaluatee source,
                                            String logic)
        Evaluate Logic. 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 string
        Returns:
        logic result
      • validate

        public static void validate​(String logic)
        Throw exception if logic is not valid
        Parameters:
        logic -
        Throws:
        org.antlr.v4.runtime.misc.ParseCancellationException