开发学习(反射)

ps:

  类执行方法的反射过程

//ServiceLocator 参看开发学习(ApplicationContextAware)

Object obj = ServiceLocator.getBean(serviceName);
Class paramTypes[] = {Map.class};
Object[] paramValue = {param};
Method method = obj.getClass().getMethod(methodName, paramTypes);
String tReturn = (String) method.invoke(obj, paramValue);

猜你喜欢

转载自blog.csdn.net/ILoveZhc/article/details/81483946