【发布时间】:2014-06-26 20:07:44
【问题描述】:
我有问题。 Json 发送的导航数据,但有些数据是动态的。
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
127.032737,
37.260704
]
}
}
几何坐标是这样的。
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[
127.032680,
37.260549
],
[
127.032680,
37.260549
]
]
}
}
当几何中的字符串类型为“LineString”时,几何中的坐标会发生变化。
但我的几何课是这样的。
public class Geometry {
String type = "";
public List<String> coordinates;
}
所以我想知道如何通过 Gson(java 类)获取这些动态数据
在我看来,我必须使用反序列化,但我不知道..
【问题讨论】:
-
@Gergo Erdosi 感谢编辑我的问题
标签: json serialization gson