java中将json转换成map

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;

ObjectMapper mapper = new ObjectMapper();
Map<String,Object> resultMap = mapper.readValue(resultStr, new TypeReference<HashMap<String,Object>>(){});
List<Object> dataList = (List<Object>)resultMap.get("data");


你可能感兴趣的:(java中将json转换成map)