@Test(expected = ConverterException.class) public void invalid_date_strings_result_in_a_conversion_exception() { new LocalDateConverter().getAsObject(mock(FacesContext.class), mock(UIComponent.class), "adsdas"); }
@Override public Object getAsObject(FacesContext context, UIComponent component, String value) { if (isBlank(value)) { return null; } try { return LocalDate.parse(value); } catch (DateTimeParseException e) { throw new ConverterException(new FacesMessage(SEVERITY_ERROR, "Please provide a date using a format like 2014-12-24", null), e); } }
LocalDateConverter implements Converter { @Override public Object getAsObject(FacesContext context, UIComponent component, String value) { if (isBlank(value)) { return null; } try { return LocalDate.parse(value); } catch (DateTimeParseException e) { throw new ConverterException(new FacesMessage(SEVERITY_ERROR, "Please provide a date using a format like 2014-12-24", null), e); } } }
LocalDateConverter implements Converter { @Override public Object getAsObject(FacesContext context, UIComponent component, String value) { if (isBlank(value)) { return null; } try { return LocalDate.parse(value); } catch (DateTimeParseException e) { throw new ConverterException(new FacesMessage(SEVERITY_ERROR, "Please provide a date using a format like 2014-12-24", null), e); } }  }
LocalDateConverter implements Converter { @Override public Object getAsObject(FacesContext context, UIComponent component, String value) { if (isBlank(value)) { return null; } try { return LocalDate.parse(value); } catch (DateTimeParseException e) { throw new ConverterException(new FacesMessage(SEVERITY_ERROR, "Please provide a date using a format like 2014-12-24", null), e); } }  @Override Object getAsObject(FacesContext context, UIComponent component, String value); @Override String getAsString(FacesContext context, UIComponent component, Object value); }
LocalDateConverter implements Converter { @Override public Object getAsObject(FacesContext context, UIComponent component, String value) { if (isBlank(value)) { return null; } try { return LocalDate.parse(value); } catch (DateTimeParseException e) { throw new ConverterException(new FacesMessage(SEVERITY_ERROR, "Please provide a date using a format like 2014-12-24", null), e); } }  @Override Object getAsObject(FacesContext context, UIComponent component, String value); @Override String getAsString(FacesContext context, UIComponent component, Object value);  }