如何将json(gson或jackson,不重要)转换为带有递归元素的json对象? json示例:(每个对象值可以包含另一个对象值)
{
"values": [
{
"name": "Name 1",
"values": [
{
"name": "Name 1.1"
}
]
},
{
"name": "Name 2"
}
]
}
我想转换为一种类
public class Simple {
public List<ValuesEntity> values;
public static class ValuesEntity {
public String name;
public List<ValuesEntity> values;
}
}