문제


I'm using JAXB and MOXy to unmarshal structure like

"coordinates": [
    [
        [
            -5.9105761,
            54.6850694
        ],
        [
            -5.6877263,
             54.6850694
        ]
    ]
]

Usually, when I'm facing json arrays, I just use code like

Integer[] coordinate;
@XmlElement(name = "coordinate")
public Integer[] getCoordinate(){
    return coordinate;
}
public void setCoordinate...

and it works. So, for that structure I wanted to use similar code

Float[][][] coordinates;
@XmlElement(name = "coordinates")
public Float[][][] getCoordinates(){...

But during unmarshalling MOXy throws NPE. Can't you tell me, what's wrong with that approach?
Regards, Mikhail.

도움이 되었습니까?

해결책

Currently MOXy does not support multi-dimensional JSON arrays. You can use the following enhancement request to track this feature:

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top