1 5 package com.opensymphony.workflow.query; 6 7 import org.apache.commons.logging.Log; 8 import org.apache.commons.logging.LogFactory; 9 10 import java.io.Serializable ; 11 12 13 18 public class WorkflowQuery implements Serializable { 19 21 private static final Log log = LogFactory.getLog(WorkflowQuery.class); 22 public final static int EQUALS = 1; 23 public final static int LT = 2; 24 public final static int GT = 3; 25 public final static int BETWEEN = 4; 26 public final static int NOT_EQUALS = 5; 27 public final static int AND = 6; 28 public final static int OR = 7; 29 public final static int XOR = 8; 30 public final static int OWNER = 1; 31 public final static int START_DATE = 2; 32 public final static int FINISH_DATE = 3; 33 public final static int ACTION = 4; 34 public final static int STEP = 5; 35 public final static int CALLER = 6; 36 public final static int STATUS = 7; 37 public final static int HISTORY = 1; 38 public final static int CURRENT = 2; 39 40 42 private Object value; 43 private WorkflowQuery left; 44 private WorkflowQuery right; 45 private int field; 46 private int operator; 47 private int type; 48 49 51 public WorkflowQuery() { 52 } 53 54 public WorkflowQuery(WorkflowQuery left, int operator, WorkflowQuery right) { 55 this.operator = operator; 56 this.left = left; 57 this.right = right; 58 } 59 60 public WorkflowQuery(int field, int type, int operator, Object value) { 61 this.type = type; 62 this.operator = operator; 63 this.field = field; 64 this.value = value; 65 } 66 67 69 public int getField() { 70 return field; 71 } 72 73 public WorkflowQuery getLeft() { 74 return left; 75 } 76 77 public int getOperator() { 78 return operator; 79 } 80 81 public WorkflowQuery getRight() { 82 return right; 83 } 84 85 public int getType() { 86 int qtype = type; 87 88 if (qtype == 0) { 89 if (getLeft() != null) { 90 qtype = getLeft().getType(); 91 } 92 } 93 94 return qtype; 95 } 96 97 public Object getValue() { 98 return value; 99 } 100 } 101 | Popular Tags |