首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 开源软件 >

spring源码不理解的有关问题

2012-06-28 
spring源码不理解的问题最近闲来无事,于是阅读spring源码,读着读着碰到一个问题百思不得其解,问题在BeanUt

spring源码不理解的问题
最近闲来无事,于是阅读spring源码,读着读着碰到一个问题百思不得其解,问题在BeanUtils中的一段代码,如下:

public static <T> T instantiateClass(Class<T> clazz) throws BeanInstantiationException {Assert.notNull(clazz, "Class must not be null");if (clazz.isInterface()) {throw new BeanInstantiationException(clazz, "Specified class is an interface");}try {return instantiateClass(clazz.getDeclaredConstructor());}catch (NoSuchMethodException ex) {throw new BeanInstantiationException(clazz, "No default constructor found", ex);}}

找了所有文件,没有找到instantiateClass函数的定义;再者,这里clazz.getDeclaredConstructor(),好像Class类中没有getDeclaredConstructor()也没有这个函数啊,小弟愚钝,请高手指教。

热点排行