![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring
文章平均质量分 79
wlyang666
何妨吟啸且徐行
展开
-
spring加载资源并装配对象过程(四)
上篇说到spring提供了方法可以在实际解析bean定义方法parseBeanDefinitions前后加自定义的操作,本篇我们详述一下parseBeanDefinitions内部实现。 /** * Parse the elements at the root level in the document: * "import", "alias", "bean". * @param r...原创 2020-03-08 01:08:45 · 327 阅读 · 0 评论 -
spring加载资源并装配对象过程(三)
上篇大致拆解了spring读取配置文件到document对象的操作,本篇紧接上篇说一下spring注册bean定义的操作。 /** * Register the bean definitions contained in the given DOM document. * Called by {@code loadBeanDefinitions}. * <p>Create...原创 2020-03-03 17:38:04 · 167 阅读 · 0 评论 -
spring 的getEntityResolver做了哪些操作
spring在读取配置文件加载bean定义的时候会用到一个方法如下: /** * Return the EntityResolver to use, building a default resolver * if none specified. */ protected EntityResolver getEntityResolver() { if (this.entityR...转载 2020-03-01 19:17:34 · 189 阅读 · 0 评论 -
spring加载资源并装配对象过程(二)
前面提到bean定义加载会通过xmlbeanDefinitionReader的方法loadBeanDefinitions()实现,下面我们想起看看这个方法做了哪些工作。通过构造方法创建xmlbeandefinitionReader的时候,会调用父类提供的构造方法,方法如下/** * Create a new AbstractBeanDefinitionReader for the give...原创 2020-03-01 19:15:57 · 124 阅读 · 0 评论 -
spring加载资源并装配对象过程(一)
常用方式我们比较常用的方式是通过xmlBeanFactory读取配置文件后再get获取bean,如下所示XmlBeanFactory xmlBeanFactory=new XmlBeanFactory(new ClassPathResource("/bean.xml"));Person person=(Person)xmlBeanFactory.getBean("person");具体实...原创 2020-03-01 11:17:07 · 265 阅读 · 0 评论 -
beanFactory和FactoryBean的区别
前面大概解读了beanFactory和factoryBean的源码注释,但是可能很多人还是一头雾水,首先是笔者的英文水平有期,其次,笔者对整个框架的理解不是很到位,所以一些翻译并不能真正表达框架设计者的意图。但是通过对两者对比,相信我们会对这两个接口有更深刻的理解。BeanFactorybeanFactory是ioc容器的接口,是一个工厂类,负责创建,管理bean,spring 中所有bean...原创 2019-12-22 11:26:08 · 112 阅读 · 0 评论 -
beanfactory内方法注释翻译
/** * Used to dereference a {@link FactoryBean} instance and distinguish it from * beans <i>created</i> by the FactoryBean. For example, if the bean named * {@code myJndiObject} is a...原创 2019-12-22 11:13:03 · 266 阅读 · 0 评论 -
spring的IOC根容器beanfactory翻译
偶然发现beanfactory的英文有点意思,特尝试翻译如下:/** * The root interface for accessing a Spring bean container. * This is the basic client view of a bean container; * further interfaces such as {@link ListableBean...原创 2019-12-18 00:53:30 · 225 阅读 · 0 评论