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.fp.document.validation.event;
017    
018    import org.kuali.kfs.fp.businessobject.Check;
019    import org.kuali.kfs.sys.document.validation.event.AttributedDocumentEventBase;
020    import org.kuali.rice.kns.document.Document;
021    
022    /**
023     * An event which is fired when a member of the Cash Receipt family of documents adds a check.
024     */ 
025    public class AddCheckEvent extends AttributedDocumentEventBase implements CheckEvent {
026        private final Check check;
027        
028        /**
029         * Initializes fields common to all subclasses
030         * 
031         * @param description
032         * @param errorPathPrefix
033         * @param document
034         * @param check
035         */
036        public AddCheckEvent(String description, String errorPathPrefix, Document document, Check check) {
037            super(description, errorPathPrefix, document);
038    
039            this.check = check;
040        }
041        
042        /**
043         * Constructs a AddCheckEvent, with a blank description
044         * @param errorPathPrefix
045         * @param document
046         * @param check
047         */
048        public AddCheckEvent(String errorPathPrefix, Document document, Check check) {
049            this("", errorPathPrefix, document, check);
050        }
051        
052        /**
053         * @see org.kuali.rice.kns.rule.event.CheckEvent#getCheck()
054         */
055        public Check getCheck() {
056            return check;
057        }
058    }