class 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);
        }
    }

}