我正在使用 JAXB/MOXy 序列化下一个二维字符串数组:
@XmlElement(name = "row")
@XmlElementWrapper(name = "rows")
private String[][] rows;
我希望它被序列化为下一个 JSON:
"rows": [
["1", "2"],
["3","4"],
["5","6"]
]
但我得到了这个:
"rows": [
{
"item": ["1","2"]
},
{
"item": ["1","2"]
},
{
"item": ["1","2"]
}
]
任何想法如何解决这一问题?