在传入的参数 为hashmap时,要设成原来的方法参数为hashMap形式的,不能用map来代替
eg.
public void eg(HashMap map,int t)
{
}
在反射时
Class cls=gddhService.getClass();
HashMap map=new HashMap()
map.put("q",2);
Class [] argsClass =new Class[2]
argsClass [0]=map.getClass();
argsClass[1]=int.Class;
Method method = cls.getMethod("eg",argsClass);
Object[] args = new Object[2];
args[0] = map ;
args[1]=3;
method.invoke(gddhService , args);