1 /* 2 * Copyright 2010 The Kuali Foundation. 3 * 4 * Licensed under the Educational Community License, Version 1.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.opensource.org/licenses/ecl1.php 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package org.kuali.ole.pdp.businessobject; 17 import org.apache.commons.lang.StringUtils; 18 import org.kuali.rice.core.api.util.type.KualiInteger; 19 import org.kuali.rice.core.web.format.CurrencyFormatter; 20 21 public class DisbursementNumberFormatter extends CurrencyFormatter { 22 /* 23 * Copyright 2006-2007 The Kuali Foundation 24 * 25 * Licensed under the Educational Community License, Version 2.0 (the "License"); 26 * you may not use this file except in compliance with the License. 27 * You may obtain a copy of the License at 28 * 29 * http://www.opensource.org/licenses/ecl2.php 30 * 31 * Unless required by applicable law or agreed to in writing, software 32 * distributed under the License is distributed on an "AS IS" BASIS, 33 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 34 * See the License for the specific language governing permissions and 35 * limitations under the License. 36 */ 37 38 protected Object convertToObject(String target) { 39 if (StringUtils.isEmpty(target)) 40 return null; 41 return new KualiInteger(target); 42 } 43 44 /** 45 * Returns a string representation of its argument formatted as a currency value. 46 */ 47 public Object format(Object obj) { 48 return (obj == null ? null : obj.toString()); 49 } 50 }