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.pdp.businessobject;
017    import java.math.BigDecimal;
018    import java.text.NumberFormat;
019    
020    import org.apache.commons.lang.StringUtils;
021    import org.kuali.rice.kns.util.KualiDecimal;
022    import org.kuali.rice.kns.util.KualiInteger;
023    import org.kuali.rice.kns.util.RiceKeyConstants;
024    import org.kuali.rice.kns.web.format.CurrencyFormatter;
025    import org.kuali.rice.kns.web.format.FormatException;
026    import org.kuali.rice.kns.web.format.Formatter;
027    
028    public class DisbursementNumberFormatter extends CurrencyFormatter {
029        /*
030         * Copyright 2006-2007 The Kuali Foundation
031         * 
032         * Licensed under the Educational Community License, Version 2.0 (the "License");
033         * you may not use this file except in compliance with the License.
034         * You may obtain a copy of the License at
035         * 
036         * http://www.opensource.org/licenses/ecl2.php
037         * 
038         * Unless required by applicable law or agreed to in writing, software
039         * distributed under the License is distributed on an "AS IS" BASIS,
040         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
041         * See the License for the specific language governing permissions and
042         * limitations under the License.
043         */
044    
045        protected Object convertToObject(String target) {
046            if (StringUtils.isEmpty(target))
047                return null;
048             return new KualiInteger(target);
049        }
050    
051        /**
052         * Returns a string representation of its argument formatted as a currency value.
053         */
054        public Object format(Object obj) {
055            return (obj == null ? null : obj.toString());
056        }
057    }