这是我的代码
String json = "{product:{\"controls\": [[\"fire\", \"na\"], [\"jump\", \"na\"], [\"movement\", \"arrow\"]], \"languages\": [\"en\",\"br\"]}}";
XStream xstream = new XStream(new JettisonMappedXmlDriver());
xstream.alias("product", Product.class);
Product product = (Product)xstream.fromXML(json);
System.out.println(product);
但我收到了这个错误
Exception in thread "main" com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter$DuplicateFieldException: controls
---- Debugging information ----
duplicate-field : controls
class : Product
required-type : Product
path : /product/controls[2]
line number : -1
-------------------------------
该代码适用于非数组数据。
我该如何解决?