01: package org.drools.brms.client.modeldriven.brl;
02:
03: /**
04: * Holds field and value for "action" parts of the rule.
05: *
06: * @author Michael Neale
07: */
08: public class ActionFieldValue implements PortableObject {
09:
10: public String field;
11: public String value;
12:
13: /**
14: * This is the datatype archectype (eg String, Numeric etc).
15: */
16: public String type;
17:
18: public ActionFieldValue(final String field, final String value,
19: final String type) {
20: this .field = field;
21: this .value = value;
22: this .type = type;
23: }
24:
25: public ActionFieldValue() {
26: }
27:
28: /**
29: * This will return true if the value is really a "formula" - in
30: * the sense of like an excel spreadsheet.
31: *
32: * If it IS a formula, then the value should never be turned into a
33: * string, always left as-is.
34: *
35: */
36: public boolean isFormula() {
37: if (this .value == null) {
38: return false;
39: }
40: if (this .value.trim().startsWith("=")) {
41: return true;
42: } else {
43: return false;
44: }
45: }
46:
47: }
|