以下方法能将常量类中的属性和值转换出来MAP
public static Map<String, Object> ConstsProperty2Map(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;
}