001    /*
002     * Copyright 2011 The Kuali Foundation.
003     * 
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     * 
008     * http://www.opensource.org/licenses/ecl2.php
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.kfs.module.bc.document.validation.event;
017    
018    import org.kuali.kfs.module.bc.BCConstants.MonthSpreadDeleteType;
019    import org.kuali.kfs.module.bc.document.BudgetConstructionDocument;
020    import org.kuali.kfs.module.bc.document.validation.DeleteMonthlySpreadRule;
021    import org.kuali.rice.kns.document.Document;
022    import org.kuali.rice.kns.rule.BusinessRule;
023    import org.kuali.rice.kns.rule.event.KualiDocumentEventBase;
024    
025    /**
026     * This class...
027     */
028    public class DeleteMonthlySpreadEvent extends KualiDocumentEventBase {
029    
030        private BudgetConstructionDocument budgetConstructionDocument;
031        private MonthSpreadDeleteType monthSpreadDeleteType;
032        
033        public DeleteMonthlySpreadEvent(Document document, MonthSpreadDeleteType monthSpreadDeleteType){
034            super("", "", document);
035            this.budgetConstructionDocument = (BudgetConstructionDocument) document;
036            this.monthSpreadDeleteType = monthSpreadDeleteType;
037        
038        }
039    
040        /**
041         * @see org.kuali.rice.kns.rule.event.KualiDocumentEvent#getRuleInterfaceClass()
042         */
043        public Class getRuleInterfaceClass() {
044    
045            return DeleteMonthlySpreadRule.class;
046        }
047    
048        /**
049         * @see org.kuali.rice.kns.rule.event.KualiDocumentEvent#invokeRuleMethod(org.kuali.rice.kns.rule.BusinessRule)
050         */
051        public boolean invokeRuleMethod(BusinessRule rule) {
052            return ((DeleteMonthlySpreadRule) rule).processDeleteMonthlySpreadRules(budgetConstructionDocument, monthSpreadDeleteType);
053        }
054    
055        /**
056         * Gets the budgetConstructionDocument attribute. 
057         * @return Returns the budgetConstructionDocument.
058         */
059        public BudgetConstructionDocument getBudgetConstructionDocument() {
060            return budgetConstructionDocument;
061        }
062    
063        /**
064         * Sets the budgetConstructionDocument attribute value.
065         * @param budgetConstructionDocument The budgetConstructionDocument to set.
066         */
067        public void setBudgetConstructionDocument(BudgetConstructionDocument budgetConstructionDocument) {
068            this.budgetConstructionDocument = budgetConstructionDocument;
069        }
070    
071    }