1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.sys.document.validation.event;
17
18 import java.util.HashMap;
19 import java.util.Map;
20
21 import org.kuali.ole.sys.document.validation.AccountingRuleEngineRule;
22 import org.kuali.rice.krad.document.Document;
23 import org.kuali.rice.krad.rules.rule.BusinessRule;
24 import org.kuali.rice.krad.rules.rule.event.KualiDocumentEventBase;
25
26
27
28
29 public class AttributedDocumentEventBase extends KualiDocumentEventBase implements AttributedDocumentEvent {
30 private Map<String, Object> attributes;
31 private Object iterationSubject;
32
33
34
35
36
37
38 protected AttributedDocumentEventBase(String description, String errorPathPrefix) {
39 super(description, errorPathPrefix);
40 attributes = new HashMap<String, Object>();
41 }
42
43
44
45
46 public AttributedDocumentEventBase(String description, String errorPathPrefix, Document document) {
47 super(description, errorPathPrefix, document);
48 attributes = new HashMap<String, Object>();
49 }
50
51
52
53
54 public Object getAttribute(String attributeName) {
55 return attributes.get(attributeName);
56 }
57
58
59
60
61 public void setAttribute(String attributeName, Object attributeValue) {
62 attributes.put(attributeName, attributeValue);
63 }
64
65
66
67
68
69 public Object getIterationSubject() {
70 return iterationSubject;
71 }
72
73
74
75
76
77 public void setIterationSubject(Object iterationSubject) {
78 this.iterationSubject = iterationSubject;
79 }
80
81
82
83
84 public Class getRuleInterfaceClass() {
85 return AccountingRuleEngineRule.class;
86 }
87
88
89
90
91 public boolean invokeRuleMethod(BusinessRule rule) {
92 return ((AccountingRuleEngineRule)rule).validateForEvent(this);
93 }
94 }