网站建设 引导,网站建设书籍资料,wordpress怎么修改html,医院网站队伍建设文章目录 spring自定义属性编辑器步骤 spring自定义属性编辑器
属性编辑器是用来解析bean的配置文件中的属性标签的#xff0c;spring的BeanWrapperImpl默认会注册CustomCollectionEditor(集合)、CustomMapEditor(Map)、CurrencyEditor(货币)、ByteArrayPropertyEditor等spring的BeanWrapperImpl默认会注册CustomCollectionEditor(集合)、CustomMapEditor(Map)、CurrencyEditor(货币)、ByteArrayPropertyEditor等可以使用CustomEditorConfigurer来注册属性编辑器CustomEditorConfigurer实现了BeanFactoryPostProcessor接口由spring容器自动检测并执行
步骤
创建一个实现PropertyEditorRegistrar接口的类重写registerCustomEditors方法负责向spring容器注册属性编辑器将PropertyEditorRegistrar实现类作为bean进行注册配置CustomEditorConfigurer这个bean并写入属性propertyEditorRegistrars中
参考文献
spring自定义属性编辑器