这是
setAttribute使用反射实现的方式(我已将函数重命名;针对不同的字段类型有不同的反射函数):
public void setIntField(String fieldName, int value) throws NoSuchFieldException, IllegalAccessException { Field field = getClass().getDeclaredField(fieldName); field.setInt(this, value);}


