• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CustomEditorConfigurer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.springframework.beans.factory.config.CustomEditorConfigurer的典型用法代码示例。如果您正苦于以下问题:Java CustomEditorConfigurer类的具体用法?Java CustomEditorConfigurer怎么用?Java CustomEditorConfigurer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CustomEditorConfigurer类属于org.springframework.beans.factory.config包,在下文中一共展示了CustomEditorConfigurer类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getWriteConcernPropertyEditorBuilder

import org.springframework.beans.factory.config.CustomEditorConfigurer; //导入依赖的package包/类
private BeanDefinitionBuilder getWriteConcernPropertyEditorBuilder() {
    Map<String, Class<?>> customEditors = new ManagedMap<>();
    customEditors.put("com.mongodb.WriteConcern", WriteConcernPropertyEditor.class);

    BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(CustomEditorConfigurer.class);
    builder.addPropertyValue("customEditors", customEditors);

    return builder;
}
 
开发者ID:lodsve,项目名称:lodsve-framework,代码行数:10,代码来源:MongoBeanDefinitionRegistrar.java


示例2: getBaseContext

import org.springframework.beans.factory.config.CustomEditorConfigurer; //导入依赖的package包/类
/**
 * Get a basic Spring {@link GenericApplicationContext} with additional 
 * custom editors registered. The additional custom editors are automatically
 * loaded from com.fortify.util.spring.propertyeditor (sub-)packages
 * if they have the {@link Component} annotation.
 * @return Basic Spring ApplicationContext with custom editors registered.
 */
public static final GenericApplicationContext getBaseContext() {
	GenericApplicationContext context = new GenericApplicationContext();
	context.setClassLoader(SpringContextUtil.class.getClassLoader());
	
	CustomEditorConfigurer cec = new CustomEditorConfigurer();
	cec.setCustomEditors(PROPERTY_EDITORS);
	context.addBeanFactoryPostProcessor(cec);
	return context;
}
 
开发者ID:fod-dev,项目名称:FoDBugTrackerUtility,代码行数:17,代码来源:SpringContextUtil.java


示例3: iocStart

import org.springframework.beans.factory.config.CustomEditorConfigurer; //导入依赖的package包/类
public static void iocStart() {
	// BeanFactory方式启动
	ConfigurableListableBeanFactory beanFactory = new XmlBeanFactory(
			new ClassPathResource("spring.xml"));

	// 读取外部properties文件属性值填充xml中的bean,property
	PropertyPlaceholderConfigurer propertyPlaceholderConfigurer = new PropertyPlaceholderConfigurer();
	propertyPlaceholderConfigurer.setLocation(new ClassPathResource(
			"config.properties"));
	// 应用postProcessBeanFactory
	propertyPlaceholderConfigurer.postProcessBeanFactory(beanFactory);

	// 读取外部properties文件,覆盖xml中bean指定的property值
	PropertyOverrideConfigurer propertyOverrideConfigurer = new PropertyOverrideConfigurer();
	propertyOverrideConfigurer.setLocation(new ClassPathResource(
			"spring-adjustment.properties"));
	propertyOverrideConfigurer.postProcessBeanFactory(beanFactory);

	// CustomEditorConfigurer,对bean的property值,做类型转换支持
	CustomEditorConfigurer customEditorConfigurer = new CustomEditorConfigurer();
	Map customEditors = new HashMap();
	customEditors.put(Date.class, new DatePropertyEditor());
	customEditorConfigurer.setCustomEditors(customEditors);
	customEditorConfigurer.postProcessBeanFactory(beanFactory);

	FXNewsProvider newsProvider = (FXNewsProvider) beanFactory
			.getBean("newsProvider");
	System.out.println(newsProvider.getClientId());
	System.out.println(newsProvider.getBaseUrl());
	System.out.println(newsProvider.getAddDate().toLocaleString());
}
 
开发者ID:bdceo,项目名称:bd-codes,代码行数:32,代码来源:FXmain.java


示例4: editorConfigurer

import org.springframework.beans.factory.config.CustomEditorConfigurer; //导入依赖的package包/类
/**
 * @Value Path converter
 */
@Bean
public static CustomEditorConfigurer editorConfigurer() {
	final CustomEditorConfigurer conf = new CustomEditorConfigurer();
	final Map<Class<?>, Class<? extends PropertyEditor>>  map = new HashMap<>();
	
	map.put(Path.class, PathEditor.class);
	
	conf.setCustomEditors(map);
	return conf;
}
 
开发者ID:Katharsas,项目名称:GMM,代码行数:14,代码来源:ApplicationConfiguration.java


示例5: registerPropertyEditors

import org.springframework.beans.factory.config.CustomEditorConfigurer; //导入依赖的package包/类
/**
 * Register default CustomEditorConfigurer
 * @return default CustomEditorComfigurer ComponentDefinition
 */
private ComponentDefinition registerPropertyEditors(Element element, ParserContext parserContext) {
	BeanDefinitionBuilder bdb = BeanDefinitionBuilder.genericBeanDefinition(
			CustomEditorConfigurer.class);
	Map<String, String> map = new HashMap<String, String>();
	map.put("com.vaadin.server.Resource", "org.jdal.vaadin.beans.VaadinResourcePropertyEditor");
	bdb.addPropertyValue("customEditors", map);
	BeanComponentDefinition bcd = new BeanComponentDefinition(bdb.getBeanDefinition(), 
			CUSTOM_EDITOR_CONFIGURER_BEAN_NAME);
	registerBeanComponentDefinition(element, parserContext, bcd);
	return bcd;
}
 
开发者ID:chelu,项目名称:jdal,代码行数:16,代码来源:DefaultsBeanDefinitionParser.java


示例6: registerPropertyEditors

import org.springframework.beans.factory.config.CustomEditorConfigurer; //导入依赖的package包/类
/**
 * @return
 */
private ComponentDefinition registerPropertyEditors(Element element, ParserContext parserContext) {
	BeanDefinitionBuilder bdb = BeanDefinitionBuilder.genericBeanDefinition(
			CustomEditorConfigurer.class);
	Map<String, String> map = new HashMap<String, String>();
	map.put("java.awt.Image", "org.jdal.beans.ImagePropertyEditor");
	map.put("javax.swing.Icon", "org.jdal.beans.IconPropertyEditor");
	bdb.addPropertyValue("customEditors", map);
	BeanComponentDefinition bcd = new BeanComponentDefinition(bdb.getBeanDefinition(), 
			CUSTOM_EDITOR_CONFIGURER_BEAN_NAME);
	registerBeanComponentDefinition(element, parserContext, bcd);
	return bcd;
}
 
开发者ID:chelu,项目名称:jdal,代码行数:16,代码来源:DefaultsBeanDefinitionParser.java



注:本文中的org.springframework.beans.factory.config.CustomEditorConfigurer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AppearancePreferencePage类代码示例发布时间:2022-05-23
下一篇:
Java SelectMultiData类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap