01: package org.drools.lang.descr;
02:
03: /**
04: * This represents direct field access.
05: * Not a whole lot different from what you can do with the method access,
06: * but in this case it is just a field by name (same as in a pattern).
07: *
08: *
09: * eg: foo.bar
10: */
11: public class FieldAccessDescr extends DeclarativeInvokerDescr {
12:
13: private static final long serialVersionUID = 400L;
14:
15: private String fieldName;
16: private String argument;
17:
18: public FieldAccessDescr(final String fieldName) {
19: this .fieldName = fieldName;
20: }
21:
22: public FieldAccessDescr(final String fieldName,
23: final String argument) {
24: this .fieldName = fieldName;
25: this .argument = argument;
26: }
27:
28: public String getFieldName() {
29: return this .fieldName;
30: }
31:
32: public void setFieldName(final String fieldName) {
33: this .fieldName = fieldName;
34: }
35:
36: public String getArgument() {
37: return this .argument;
38: }
39:
40: public void setArgument(final String argument) {
41: this .argument = argument;
42: }
43:
44: public String toString() {
45: return this .fieldName
46: + ((this .argument != null) ? this .argument : "");
47: }
48:
49: }
|