public static Object json2Object(String jsonString, Class<?> c) {

        if (jsonString == null || "".equals(jsonString)) {
            return "";
        } else {
            try {
                return objectMapper.readValue(jsonString, c);
            } catch (Exception e) {
                log.warn("json error:" + e.getMessage());
            }

        }
        return "";
    }
public static Object json2Object ( String jsonString , Class < ? > c ) { if ( jsonString == null || "" . equals ( jsonString ) ) { return "" ; } else { try { return objectMapper . readValue ( jsonString , c ) ; } catch ( Exception e ) { log . warn ( "json error:" + e . getMessage ( ) ) ; } } return "" ; }
Json字符串转Java对象