public class PointSerializer extends java.lang.Object implements com.google.gson.JsonSerializer<Point>
Constructor and Description |
---|
PointSerializer()
Empty constructor to prevent relying on the default one.
|
Modifier and Type | Method and Description |
---|---|
com.google.gson.JsonElement |
serialize(Point src,
java.lang.reflect.Type typeOfSrc,
com.google.gson.JsonSerializationContext context)
Required to handle the special case where the altitude might be a Double.NaN, which isn't a
valid double value as per JSON specification.
|
public PointSerializer()
public com.google.gson.JsonElement serialize(Point src, java.lang.reflect.Type typeOfSrc, com.google.gson.JsonSerializationContext context)
serialize
in interface com.google.gson.JsonSerializer<Point>
src
- A Point
defined by a longitude, latitude, and optionally, an
altitude.typeOfSrc
- Common superinterface for all types in the Java.context
- Context for deserialization that is passed to a custom deserializer during
invocation of its JsonDeserializationContext
method.