1 12 package org.eclipse.jface.internal.databinding.provisional.conversion; 13 14 import java.math.BigDecimal ; 15 16 17 18 21 public class ConvertString2BigDecimal implements IConverter { 22 23 26 public Object convert(Object source) { 27 try { 28 return new BigDecimal ((String )source); 29 } catch (Exception e) { 30 throw new IllegalArgumentException ("String2BigDecimal: " + e.getMessage() + ": " + source); } 32 } 33 34 public Object getFromType() { 35 return String .class; 36 } 37 38 public Object getToType() { 39 return BigDecimal .class; 40 } 41 42 } 43 | Popular Tags |