找到塞特犬
/**n o w j a v a . c o m - 时代Java**/ import java.lang.reflect.Method; import org.apache.log4j.Logger; public class Main{ public static Method findSetter(Class<?> onClass, String field) { String methodName = "set" + field.substring(0, 1).toUpperCase() + field.substring(1); Method[] methods = onClass.getMethods(); for (int i = 0; i < methods.length; i++) { Method method = methods[i]; if (method.getName().equals(methodName)) { return method; } } methodName = field; for (int i = 0; i < methods.length; i++) { Method method = methods[i]; if (method.getNam