/** * 得到某个类的静态属性 java反射机制 * * @param className * @param fieldName * @return * @throws Exception */ public Object getStaticProperty(String className, String fieldName) throws Exception { Class ownerClass = Class.forName(className); Field field = ownerClass.getField(fieldName); Object property = field.get(ownerClass); return property; }