pl.fhframework.model.forms.converters.LocalDateDeserializer Maven / Gradle / Ivy
package pl.fhframework.model.forms.converters;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import java.io.IOException;
import java.time.LocalDate;
public class LocalDateDeserializer extends StdDeserializer {
protected LocalDateDeserializer() {
super(LocalDate.class);
}
@Override
public LocalDate deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
return LocalDate.parse(jsonParser.readValueAs(String.class));
}
}