參考:
https://blog.csdn.net/weixin_41562778/article/details/80372365
http://www.reibang.com/p/944930a0ba33
http://www.reibang.com/p/aeb97395d9c5
前面介紹了PropertyEditor的功能,在BeanFactory中融合了PropertyEditor在BeanDefinition定義啟動(dòng)的數(shù)據(jù)類型轉(zhuǎn)換的作用
1.BeanFactory中的定義
2.CustomEditorConfigurer
CustomEditorConfigurer實(shí)現(xiàn)了BeanFactoryPostProcessor,間接的調(diào)用了
BeanFactory的addPropertyEditorRegistrar和registerCustomEditor方法
3.PropertyEditorRegistrar接口
在registerCustomEditors方法中開發(fā)了PropertyEditorRegistry接口存崖,可以使用PropertyEditorRegistry接口的registerCustomEditor方法注冊(cè)自定義PropertyEditor
public interface PropertyEditorRegistrar {
void registerCustomEditors(PropertyEditorRegistry registry);
}