/*
/*
反射机制:通过字段名和参数获取setter方法
*/
public static Method convertSetter(Class cla, String field, Class<?>... parameterTypes) {
String str1 = field.substring(0, 1);
String str2 = field.substring(1, field.length());
String method_set = "set" + str1.toUpperCase() + str2;
Method method1 = null;
try {
method1 = cla.getMethod(method_set, parameterTypes);
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
return method1;
}
反射机制:通过字段名和参数获取setter方法
*/
public static Method convertSetter(Class cla, String field, Class<?>... parameterTypes) {
String str1 = field.substring(0, 1);
String str2 = field.substring(1, field.length());
String method_set = "set" + str1.toUpperCase() + str2;
Method method1 = null;
try {
method1 = cla.getMethod(method_set, parameterTypes);
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
return method1;
}