本文整理汇总了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;未经允许,请勿转载。 |
请发表评论