1,学习spring源码笔记
下面是各个类的作用
容器的基础是xmlBeanFactory
XmlBeanFactory bf = new XmlBeanFactory (new ClassPathResource(“beanFactoryTest.xml”))
classPathResource是一个资源统一解析器
@Override
public InputStream getInputStream() throws IOException {
InputStream is;
if (this.clazz != null) {
is = this.clazz.getResourceAsStream(this.path);
}
else if (this.classLoader != null) {
is = this.classLoader.getResourceAsStream(this.path);
}
else {
is = ClassLoader.getSystemResourceAsStream(this.path);
}
if (is == null) {
throw new FileNotFoundException(getDescription() + " cannot be opened because it does not exist");
}
return is;
}