📜  objectMapper 读取类型列表 - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:04.888000             🧑  作者: Mango

代码示例1
// As array (then convert to a list)
MyClass[] myObjects = mapper.readValue(json, MyClass[].class);

// With TypeReference
List myObjects = mapper.readValue(jsonInput, new TypeReference>(){});

// with TypeFactory
List myObjects = mapper.readValue(jsonInput, mapper.getTypeFactory().constructCollectionType(List.class, MyClass.class));