StdItemStrategyAppService person = new StdItemStrategyAppService();
Class extends StdItemStrategyAppService> aClass = person.getClass();
StdItemStrategyAppService stdItemStrategyAppService = null;
try {
stdItemStrategyAppService = aClass.newInstance();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
// 获取Person的Class实例
Method[] methods = aClass.getMethods();
for (Method method : methods) {
System.out.println("方法名: " + method);
}
List list;
list = new ArrayList<>();
list.add("111");
try {
Method findEquip = aClass.getMethod("findEquip", new Class[]{String.class, List.class});
findEquip.invoke(stdItemStrategyAppService, "111", list);
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}