获取字段的设置方法
/**from 时 代 J a v a**/ //package com.nowjava; import java.lang.reflect.Method; public class Main { public static Method getSetterMethodForField(Object obj, String fieldName, Class type) throws NoSuchMethodException { return obj.getClass().getDeclaredMethod(fieldName, type); } }