(转)解决fasterxml中string字符串转对象json格式错误问题(无引号 单引号问题) 解决fasterxml中string字符串转对象json格式错误问题

原文地址:解决fasterxml中string字符串转对象json格式错误问题

com.fasterxml.jackson.databind.ObjectMapper mapper = new com.fasterxml.jackson.databind.ObjectMapper();
//允许使用未带引号的字段名
mapper.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
//允许使用单引号
mapper.configure(Feature.ALLOW_SINGLE_QUOTES, true);

mapper.readValue(字符串, javabean.class);

猜你喜欢

转载自www.cnblogs.com/dlsunf/p/8950001.html