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.sys.document.datadictionary;
017    
018    import org.kuali.kfs.sys.document.FinancialSystemMaintenanceDocument;
019    import org.kuali.rice.kns.datadictionary.MaintenanceDocumentEntry;
020    import org.kuali.rice.kns.document.Document;
021    
022    /**
023     * This class allows the system to define a custom document base class for
024     */
025    public class FinancialSystemMaintenanceDocumentEntry extends MaintenanceDocumentEntry {
026    
027        /**
028         * @see org.kuali.rice.kns.datadictionary.DocumentEntry#setDocumentClass(java.lang.Class)
029         */
030        public Class<? extends Document> getStandardDocumentBaseClass() {
031            return FinancialSystemMaintenanceDocument.class;
032        }
033    
034        /**
035         * @see org.kuali.rice.kns.datadictionary.DocumentEntry#setDocumentClass(java.lang.Class)
036         */
037        @Override
038        public void setDocumentClass(Class<? extends Document> documentClass) {
039            if (!FinancialSystemMaintenanceDocument.class.isAssignableFrom(documentClass)) {
040                throw new IllegalArgumentException("document class '" + documentClass + "' needs to have a superclass of '" + FinancialSystemMaintenanceDocument.class + "'");
041            }
042            super.setDocumentClass(documentClass);
043        }
044    
045    }