spring PropertyEditor源码分析

问题:两个互相没有子父关系的对象可以为什么可以注入

1.AbstractBeanFactory 的doGetBean()方法

spring PropertyEditor源码分析_第1张图片
AbstractBeanFactory

2.通过TypeConverterSupport方法转换,方法内部调用TypeConverterDelegat的convertIfNecessary进行转换

spring PropertyEditor源码分析_第2张图片
TypeConverterSupport

3.通过TypeConverterDelegete的convertIfNecessary方法查找转换器

spring PropertyEditor源码分析_第3张图片
TypeConverterDelegete

4.通过BeanUtils的findEditorByConvention获取默认转换器

spring PropertyEditor源码分析_第4张图片
BeanUtils

5.最后能通过相应的转换器(PropertyEditor的实现类获取value),通过 PropertyEditor的getValue方法

spring PropertyEditor源码分析_第5张图片
ValueOperationsEditor

你可能感兴趣的:(spring PropertyEditor源码分析)