org.opentripplanner.api.json.JodaLocalDateDeserializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
package org.opentripplanner.api.json;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import org.joda.time.LocalDate;
import org.joda.time.format.ISODateTimeFormat;
import java.io.IOException;
/** serializer/deserializer for LocalDates to ISO dates, YYYY-MM-DD */
public class JodaLocalDateDeserializer extends JsonDeserializer {
@Override public LocalDate deserialize(JsonParser jsonParser,
DeserializationContext deserializationContext)
throws IOException, JsonProcessingException {
return ISODateTimeFormat.date().parseLocalDate(jsonParser.getValueAsString());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy