01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.kuali.module.financial.rule.event;
17:
18: import org.kuali.core.document.Document;
19: import org.kuali.core.rule.BusinessRule;
20: import org.kuali.kfs.document.AccountingDocument;
21: import org.kuali.module.financial.bo.Check;
22: import org.kuali.module.financial.rule.DeleteCheckRule;
23:
24: /**
25: * This class represents the delete check event. This could be triggered when a user presses the delete button for a given
26: * document's check line.
27: */
28: public final class DeleteCheckEvent extends CheckEventBase {
29: /**
30: * Constructs a DeleteCheckEvent with the given errorPathPrefix, document, and accountingLine.
31: *
32: * @param errorPathPrefix
33: * @param document
34: * @param accountingLine
35: */
36: public DeleteCheckEvent(String errorPathPrefix, Document document,
37: Check check) {
38: super (
39: "deleting check from document "
40: + getDocumentId(document), errorPathPrefix,
41: document, check);
42: }
43:
44: /**
45: * @see org.kuali.core.rule.event.KualiDocumentEvent#getRuleInterfaceClass()
46: */
47: public Class getRuleInterfaceClass() {
48: return DeleteCheckRule.class;
49: }
50:
51: /**
52: * @see org.kuali.core.rule.event.KualiDocumentEvent#invokeRuleMethod(org.kuali.core.rule.BusinessRule)
53: */
54: public boolean invokeRuleMethod(BusinessRule rule) {
55: return ((DeleteCheckRule) rule)
56: .processDeleteCheckBusinessRules(
57: (AccountingDocument) getDocument(), getCheck());
58: }
59: }
|