@Override public JsonValue encode(LocalDate value) { String dateString; if (value == null) { dateString = getNullRepresentation(); } else if (getLocaleFromGrid) { if (getParentGrid() == null) { throw new IllegalStateException( "Could not find a locale to format with: " + "this renderer should either be attached to a grid " + "or constructed with locale information"); } dateString = value.format(formatterSupplier.get() .withLocale(getParentGrid().getLocale())); } else { dateString = value.format(formatterSupplier.get()); } return encode(dateString, String.class); }