SimpleDateFormatTS implements FormatTS { @Override public Object parse(String data) { if (data!=null && data.length()>0) { try { return getDateFormatterInstance().parseObject(data); } catch (ParseException e) { logger.error("error parsing date string:" + data, e); } } return null; }  @Override String formatObject(Object item); @Override Object parse(String data);  }
@Test public void parse() { GregorianCalendar cal = new GregorianCalendar(); cal.set(2012, 9, 9, 8, 7, 6); cal.set(GregorianCalendar.MILLISECOND, 0); Assert.assertEquals(cal.getTime(), simpleDateFormat.parse("20121009080706")); }
@Test public void parse_null() { Assert.assertNull(simpleDateFormat.parse(null)); }