我正在使用JAXB和MOXy来解组类似以下结构的内容:
"coordinates": [
[
[
-5.9105761,
54.6850694
],
[
-5.6877263,
54.6850694
]
]
]
通常,当我面对JSON数组时,我只需使用以下代码:
Integer[] coordinate;
@XmlElement(name = "coordinate")
public Integer[] getCoordinate(){
return coordinate;
}
public void setCoordinate...
并且它可以正常运行。因此,对于那个结构,我想使用类似的代码。
Float[][][] coordinates;
@XmlElement(name = "coordinates")
public Float[][][] getCoordinates(){...
但是在MOXy反序列化过程中会抛出NPE(空指针异常)。你能告诉我,这个方法有什么问题吗?
谢谢,Mikhail。