01: package org.drools.brms.client.modeldriven.brl;
02:
03: /**
04: * This holds values for rule attributes (eg salience, agenda-group etc).
05: * @author Michael Neale
06: */
07: public class RuleAttribute implements PortableObject {
08:
09: private static final String NOLOOP = "no-loop";
10: private static final String SALIENCE = "salience";
11:
12: public RuleAttribute(final String name, final String value) {
13: this .attributeName = name;
14: this .value = value;
15: }
16:
17: public String attributeName;
18: public String value;
19:
20: public RuleAttribute() {
21: }
22:
23: public String toString() {
24: StringBuffer ret = new StringBuffer();
25: ret.append(this .attributeName);
26: if (NOLOOP.equals(attributeName)) {
27: ret.append(" ");
28: ret.append(this .value == null ? "true" : this .value);
29: } else if (SALIENCE.equals(this .attributeName)) {
30: ret.append(" ");
31: ret.append(this .value);
32: } else if (this .value != null) {
33: ret.append(" \"");
34: ret.append(this .value);
35: ret.append("\"");
36: }
37: return ret.toString();
38: }
39:
40: }
|