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.web.struts;
017    
018    import org.kuali.kfs.fp.document.PreEncumbranceDocument;
019    import org.kuali.kfs.sys.web.struts.KualiAccountingDocumentFormBase;
020    
021    /**
022     * This class is the Struts specific form object that works in conjunction with the pojo utilities to build the UI.
023     */
024    public class PreEncumbranceForm extends KualiAccountingDocumentFormBase {
025        private static final long serialVersionUID = 1L;
026    
027        /**
028         * Constructs a PreEncumbranceForm.java.
029         */
030        public PreEncumbranceForm() {
031            super();
032        }
033    
034        @Override
035        protected String getDefaultDocumentTypeName() {
036            return "PE";
037        }
038        
039        /**
040         * @return Returns the preEncumbranceDocument.
041         */
042        public PreEncumbranceDocument getPreEncumbranceDocument() {
043            return (PreEncumbranceDocument) getDocument();
044        }
045    
046        /**
047         * @param preEncumbranceDocument The preEncumbranceDocument to set.
048         */
049        public void setPreEncumbranceDocument(PreEncumbranceDocument preEncumbranceDocument) {
050            setDocument(preEncumbranceDocument);
051        }
052    
053        /**
054         * This method returns the reversal date in the format MMM d, yyyy.
055         * 
056         * @return String
057         */
058        public String getFormattedReversalDate() {
059            return formatReversalDate(getPreEncumbranceDocument().getReversalDate());
060        }
061    }