有这样的一个json文件,
定义了Bean是:
public class SyncFileResponse{
private SyncFileResponseContent content;
...
}
@JSONType(serialzeFeatures= SerializerFeature.BeanToArray, parseFeatures= Feature.SupportArrayToBean)
public class SyncFileResponseContent{
private List<FileModel> fileModel;
private List<LibCategoryBean> categoryModel;
private LibrarySyncStatusBean syncStatusBean;
private List<GroupRelateFileBean> groupRelateFileBeen;
private List<LibTagBean> tagBeen;
private List<LibTagRelatedBean> tagRelatedBeen;
....
}
SyncFileResponse model = JSON.parseObject(jsonString, SyncFileResponse.class, Feature.SupportArrayToBean);
报错
问题是否在于 LibCategoryBean 也采用了SupportArrayToBean的解析方式,是否可以定制下LibCategoryBean采用默认的解析方式
2条答案
按热度按时间ocebsuys1#
你是希望全部BeanToArray还是局部采用?
6ojccjat2#
@wenshao
SupportArrayToBean 部分采用