使用MOXy反序列化嵌套数组

3


我正在使用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。

1个回答

2

太糟糕了!@BlaiseDoughan,我们有机会得到这个功能吗?这张票好像已经很久没有动静了。 - omilke

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接