Compiere 3.1

org.compiere.util
Class Evaluator

java.lang.Object
  extended by org.compiere.util.Evaluator

public class Evaluator
extends Object

Expression Evaluator

Version:
$Id: Evaluator.java,v 1.3 2006/07/30 00:54:36 jjanke Exp $
Author:
Jorg Janke

Field Summary
static CompiereLogger log
          Static Logger
 
Constructor Summary
Evaluator()
           
 
Method Summary
static boolean evaluateLogic(Evaluatee source, String logic)
          Evaluate Logic.
static boolean evaluateLogicTuple(String value1, String operand, String value2)
          Evaluate Logic Tuple
static ArrayList<String> getVariables(String raw)
           
static boolean isAllVariablesDefined(Evaluatee source, String logic)
          Check if All Variables are Defined
static void parseDepends(ArrayList<String> list, String parseString)
          Parse String and add variables with @ to the list.
static String replaceVariables(String raw, Ctx ctx, WindowCtx windowCtx)
           
static String stripVariables(String raw)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static CompiereLogger log
Static Logger

Constructor Detail

Evaluator

public Evaluator()
Method Detail

isAllVariablesDefined

public static boolean isAllVariablesDefined(Evaluatee source,
                                            String logic)
Check if All Variables are Defined

Parameters:
source - source
logic - logic info
Returns:
true if fully defined

evaluateLogic

public static boolean evaluateLogic(Evaluatee source,
                                    String logic)
Evaluate Logic. format := [ ] expression := @@ logic := <|> | <&> exLogic := <=> | | <^> | <<> | <>> context := any global or window context value := strings can be with ' or " logic operators := AND or OR with the prevoius result from left to right Example '@AD_Table@=Test | @Language@=GERGER

Parameters:
source - class implementing get_ValueAsString(variable)
logic - logic string
Returns:
locic result

evaluateLogicTuple

public static boolean evaluateLogicTuple(String value1,
                                         String operand,
                                         String value2)
Evaluate Logic Tuple

Parameters:
value1 - value
operand - operand = ~ ^ ! > <
value2 -
Returns:
evaluation

parseDepends

public static void parseDepends(ArrayList<String> list,
                                String parseString)
Parse String and add variables with @ to the list.

Parameters:
list - list to be added to
parseString - string to parse for variables

replaceVariables

public static String replaceVariables(String raw,
                                      Ctx ctx,
                                      WindowCtx windowCtx)

stripVariables

public static String stripVariables(String raw)

getVariables

public static ArrayList<String> getVariables(String raw)

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.