http://stephen830.iteye.com/blog/256723
http://topic.csdn.net/u/20100628/17/7729635b-a226-4bf5-aae1-c5e14924e575.html
public static Map<String, Object> dumpProperty2Map(Class obj) { Map<String, Object> map = new Hashtable<String, Object>(); Field[] field1 = obj.getDeclaredFields(); for (int i = 0; i < field1.length; i++) { field1[i].setAccessible(true); try { map.put(field1[i].getName(), field1[i].get(obj)); } catch (IllegalArgumentException e1) { throw new STBSystemException(e1); } catch (IllegalAccessException e2) { throw new STBSystemException(e2); } } return map; }
好用