@SuppressWarnings("unchecked")
    public static <T> T jsonToObject(String jsonString, Class<T> pojoCalss) {
        try{
            Object pojo;
            net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(jsonString);
            pojo = net.sf.json.JSONObject.toBean(jsonObject, pojoCalss);
            return (T)pojo;
        }catch(Exception ex){
            ex.printStackTrace();
            
            return null;
        }
    }

http://blog.csdn.net/testcs_dn/article/details/42711339

相关文章:

  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-14
  • 2022-12-23
  • 2021-10-03
猜你喜欢
  • 2021-11-28
  • 2021-10-11
  • 2022-02-07
  • 2022-01-14
  • 2022-12-23
  • 2022-02-07
  • 2022-12-23
相关资源
相似解决方案