@Test public void testDecode__illegalArgument() { String[] illegals = { "30-02-2012", "32-01-2012", "27 kwietnia 2012", "01-01.2012", "01-01/2012", "01.01-2012", "01.01/2012", "01/01.2012", "01/01-2012", "2012-01.01", "2012-01/01", "2012.01-01", "2012.01/01", "2012/01-01", "2012/01.01" }; for (String text : illegals) { try { type.decode(text); fail(); } catch (RuntimeException e) { System.out.println("OK: " + e.getMessage()); } } }
@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; }