1 package jodd.datetime.converters; 2 3 import jodd.datetime.DateTimeStamp; 4 import jodd.datetime.JDateTime; 5 6 public class JDateTimeConverter implements jodd.datetime.JdtConverter { 7 8 9 public void load(JDateTime gt, Object o) { 10 if (o instanceof JDateTime) { 11 DateTimeStamp t = ((JDateTime) o).getDateTimeStamp(); 12 gt.setDateTimeStamp(t); 13 } 14 } 15 16 public Object get(JDateTime gt) { 17 return new JDateTime(gt); 18 } 19 20 public void store(JDateTime gt, Object o) { 21 if (o instanceof JDateTime) { 22 JDateTime g = (JDateTime) o; 23 DateTimeStamp t = gt.getDateTimeStamp(); 24 g.setDateTimeStamp(t); 25 } 26 } 27 28 29 } 30 | Popular Tags |