spring笔记-PropertyEditor和BeanFact

2018-12-23  本文已影响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);
}
上一篇 下一篇

猜你喜欢

热点阅读