json 泛型对象的序列化 parseObject by TypeReference

2021-07-23 10:27:14 浏览数 (1)

public static T parseObject(String text,TypeReference type,Feature... features) { return parseObject(text, type.type,ParserConfig.global,DEFAULT_PARSER_FEATURE, features); }

用法示例:

TypeReference>>MAP_TYPE_REFERENCE =new TypeReference>>(){}; JSON.parseObject(text,MAP_TYPE_REFERENCE);

0 人点赞