1 package dinamica; 2 3 import java.util.Date ; 4 5 15 public class ValidatorUtil 16 { 17 18 25 public static Date testDate(String dateValue, String dateFormat) 26 { 27 28 try 29 { 30 Date d = StringUtil.getDateObject(dateValue, dateFormat); 31 return d; 32 } 33 catch (Throwable e) 34 { 35 return null; 36 } 37 38 } 39 40 46 public static Double testDouble(String doubleValue) 47 { 48 49 try 50 { 51 double d = Double.parseDouble(doubleValue); 52 return new Double (d); 53 } 54 catch (Throwable e) 55 { 56 return null; 57 } 58 59 } 60 61 67 public static Integer testInteger(String integerValue) 68 { 69 70 try 71 { 72 int i = Integer.parseInt(integerValue); 73 return new Integer (i); 74 } 75 catch (Throwable e) 76 { 77 return null; 78 } 79 80 } 81 82 } 83 | Popular Tags |