@Test public void testDecode() { Date date = d("27-04-2012"); Object[][] testCases = { {"27-04-2012", date}, {"27.04.2012", date}, {"27/04/2012", date}, {"2012-04-27", date}, {"2012.04.27", date}, {"2012/04/27", date}, {" 2012/04/27 ", date}, {" ", null}, {null, null} }; for (Object[] testCase : testCases) { String text = (String) testCase[0]; Date expectedDate = (Date) testCase[1]; DateHolder result = type.decode(text); assertEquals(expectedDate, result.getValue()); assertEquals(expectedDate, result.getDate()); assertEquals(new DateHolder(expectedDate), result); } }
@Override public DateHolder decode(String text) { Date date = EngineUtil.hasText(text) ? guess(text) : null; return new DateHolder(date); }
DateType implements Type<DateHolder> { @Override public DateHolder decode(String text) { Date date = EngineUtil.hasText(text) ? guess(text) : null; return new DateHolder(date); } }
DateType implements Type<DateHolder> { @Override public DateHolder decode(String text) { Date date = EngineUtil.hasText(text) ? guess(text) : null; return new DateHolder(date); }  }
DateType implements Type<DateHolder> { @Override public DateHolder decode(String text) { Date date = EngineUtil.hasText(text) ? guess(text) : null; return new DateHolder(date); }  @Override String encode(DateHolder holder); @Override DateHolder decode(String text); @Override DateHolder convert(Object obj); @Override DateHolder[] newArray(int size); static void setDefaultOutputPattern(String pattern); static String getDefaultOutputPattern(); }
DateType implements Type<DateHolder> { @Override public DateHolder decode(String text) { Date date = EngineUtil.hasText(text) ? guess(text) : null; return new DateHolder(date); }  @Override String encode(DateHolder holder); @Override DateHolder decode(String text); @Override DateHolder convert(Object obj); @Override DateHolder[] newArray(int size); static void setDefaultOutputPattern(String pattern); static String getDefaultOutputPattern(); static final String TYPE_NAME; }