spring笔记-PropertyEditor和BeanFactory

参考:
https://blog.csdn.net/weixin_41562778/article/details/80372365
https://www.jianshu.com/p/944930a0ba33

https://www.jianshu.com/p/aeb97395d9c5
前面介绍了PropertyEditor的功能,在BeanFactory中融合了PropertyEditor在BeanDefinition定义启动的数据类型转换的作用

1.BeanFactory中的定义

2.CustomEditorConfigurer

CustomEditorConfigurer实现了BeanFactoryPostProcessor,间接的调用了
BeanFactory的addPropertyEditorRegistrar和registerCustomEditor方法

3.PropertyEditorRegistrar接口

在registerCustomEditors方法中开发了PropertyEditorRegistry接口,可以使用PropertyEditorRegistry接口的registerCustomEditor方法注册自定义PropertyEditor

public interface PropertyEditorRegistrar {
    void registerCustomEditors(PropertyEditorRegistry registry);
}
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容