public class PositionDeserializer extends Object implements com.google.gson.JsonDeserializer<com.mapbox.services.commons.models.Position>
Constructor and Description |
---|
PositionDeserializer() |
Modifier and Type | Method and Description |
---|---|
com.mapbox.services.commons.models.Position |
deserialize(com.google.gson.JsonElement json,
Type typeOfT,
com.google.gson.JsonDeserializationContext context)
Required to handle the "Expected BEGIN_OBJECT but was BEGIN_ARRAY" error that Gson would show
otherwise.
|
public com.mapbox.services.commons.models.Position deserialize(com.google.gson.JsonElement json, Type typeOfT, com.google.gson.JsonDeserializationContext context) throws com.google.gson.JsonParseException
deserialize
in interface com.google.gson.JsonDeserializer<com.mapbox.services.commons.models.Position>
json
- A class representing an element of Json.typeOfT
- Common superinterface for all types in the Java.context
- Context for deserialization that is passed to a custom deserializer during
invocation of its JsonDeserializer.deserialize(JsonElement, Type,
JsonDeserializationContext)
method.Position
with an altitude or one that doesn't.com.google.gson.JsonParseException
- This exception is raised if there is a serious issue that occurs
during parsing of a Json string.© 2015–2016 Mapbox. All rights reserved.