JsonConfig cfg = new JsonConfig(); cfg.setPropertySetStrategy(new PropertySetStrategy() { @Override public void setProperty(Object bean,String key,Object value) throws JSONException { try { PropertyUtils.setNestedProperty(bean,key,value); } catch (Exception e) { e.printStackTrace(); } } }); cfg.setRootClass(TweetView.class); TweetView tv = (TweetView) JSONObject.toBean(jo,cfg);
json转换成对像过滤掉无用的属性