【发布时间】:2019-04-02 11:50:30
【问题描述】:
在Json文件下方给出
[
"a",
"b",
"c"
]
我需要为上面的 Json 创建 POJO 类。我试过下面的代码
public class Elements{
public String element;
public Elements(String element){
this.element = element;
}
}
…………
public class OuterElement{
Elements[] elements;
//Getter and Setter
}
但我得到以下异常
com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of [...] out of START_ARRAY token
这种情况下的POJO类应该怎么做?
【问题讨论】: