JSON未命名的数组到Java Object

时间:2015-08-09 12:03:22

标签: java json gson

我正在尝试转换以下JSON对象

{"myFirstArray":[[266.38,0.196],[266.37,3.399],[266.35,0.192],[266.33,0.101],[266.32,0.214],[266.29,0.203],[266.24,6.54],[266,1],[265.94,4.617],[265.73,2.13],[265.72,6.576],[265.71,0.049],[265.68,17.87],[265.67,39.191],[265.51,0.01],[265.18,0.793],[265.11,0.04],[265.01,0.544],[265,22.919],[264.82,3.493]],"mySecondArray":[[268.54,0.354],[268.29,0.3],[268.26,1.336],[268.15,0.01],[267.97,7.247],[267.96,10],[267.88,0.052],[267.77,0.013],[267.74,40.992],[267.71,20],[267.7,0.506],[267.65,0.075],[267.53,5.568],[267.49,0.064],[267.48,0.096],[267.34,0.71],[267.23,2.675],[267.19,32],[267,1.05],[266.9,0.98]],"simpleObject":"1234"}

到Java类MyObject(下面),我目前正在使用GSON,但找不到任何关于如何转换未命名值数组的文档或示例。

public class MyObject{
    Pair myFirstArray[];
    Pair myFirstArray[];
    int simpleObject;
}
public class Pair {
    float foo;
    float bar;
}

0 个答案:

没有答案