修正ExcelField声明在get方法上时提示wrong number of arguments
This commit is contained in:
@@ -538,15 +538,13 @@ public class ExcelImport implements Closeable {
|
||||
ReflectUtils.invokeSetter(e, ef.attrName(), val);
|
||||
}else{
|
||||
if (os[1] instanceof Field){
|
||||
//ReflectUtils.invokeSetter(e, ((Field)os[1]).getName(), val);
|
||||
((Field)os[1]).set(e, val);
|
||||
ReflectUtils.invokeSetter(e, ((Field)os[1]).getName(), val);
|
||||
}else if (os[1] instanceof Method){
|
||||
//String mthodName = ((Method)os[1]).getName();
|
||||
//if ("get".equals(mthodName.substring(0, 3))){
|
||||
// mthodName = "set"+StringUtils.substringAfter(mthodName, "get");
|
||||
//}
|
||||
//ReflectUtils.invokeMethod(e, mthodName, new Class[] {valType}, new Object[] {val});
|
||||
((Method)os[1]).invoke(e, val);
|
||||
String mthodName = ((Method)os[1]).getName();
|
||||
if ("get".equals(mthodName.substring(0, 3))){
|
||||
mthodName = "set"+mthodName.substring(3);
|
||||
}
|
||||
ReflectUtils.invokeMethodByAsm(e, mthodName, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user