我正在尝试将json转换为jaxb对象,但我得到了错误。我正在尝试不同的变体。
示例JSON
"data": [
[5426, 0, 5805, 0, 6144, 0, 6496, 0, 6885, 0, 7462, 0, 8023, 0, 8603, 0, 9239, 0, 10412, 0, 11630, 0, 11629, 0, 97754, 0],
[37443, 0, 40597, 0, 42536, 0, 44193, 0, 45839, 0, 47422, 0, 48826, 0, 50163, 0, 51376, 0, 52232, 0, 52858, 0, 52853, 0, 566338, 0]
]
此变体返回错误 方法抛出'java.lang.NullPointerException'异常。
示例java代码
@XmlElement(name = "data")
private int[][] data;
public int[][] getData() {
return data;
}
public void setData(int[][] data) {
this.data = data;
}
@XmlElement(name = "data")
private List<List<Integer>> data;
public List<List<Integer>> getData() {
return data;
}
public void setData(List<List<Integer>> data) {
this.data = data;
}