use of com.fasterxml.jackson.core.ObjectCodec in project oc-explorer by devgateway.
the class GeoJsonPointDeserializer method deserialize.
@Override
public GeoJsonPoint deserialize(final JsonParser jsonParser, final DeserializationContext ctxt) throws IOException {
ObjectCodec objectCodec = jsonParser.getCodec();
JsonNode jsonNode = objectCodec.readTree(jsonParser);
ArrayNode coordinate = (ArrayNode) jsonNode.get("coordinates");
return new GeoJsonPoint(coordinate.get(0).asDouble(), coordinate.get(1).asDouble());
}
Aggregations