美文网首页
spring笔记-PropertyEditor和BeanFact

spring笔记-PropertyEditor和BeanFact

作者: 兴浩 | 来源:发表于2018-12-23 18:28 被阅读11次

参考:
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);
}

相关文章

网友评论

      本文标题:spring笔记-PropertyEditor和BeanFact

      本文链接:https://www.haomeiwen.com/subject/adwnkqtx.html