摘要:
1. java.lang.reflect.Method o // UserService instrance, refObject // class instrance, eg UserDAOImpl (implement UserDAO) methodName = "setUserDAO"; // Method m = o.getClass().getMethod(methodName, refObject.getClass().getInterfaces()[0]); m.invoke(o, refObject); // = o.setUserDAO(refObject 阅读全文