Example usage for org.springframework.beans.factory.config CustomEditorConfigurer setCustomEditors

List of usage examples for org.springframework.beans.factory.config CustomEditorConfigurer setCustomEditors

Introduction

In this page you can find the example usage for org.springframework.beans.factory.config CustomEditorConfigurer setCustomEditors.

Prototype

public void setCustomEditors(Map<Class<?>, Class<? extends PropertyEditor>> customEditors) 

Source Link

Document

Specify the custom editors to register via a Map , using the class name of the required type as the key and the class name of the associated PropertyEditor as value.

Usage

From source file:net.przemkovv.sphinx.config.ApplicationConfig.java

@Bean
public CustomEditorConfigurer getCustomEditorConfigurer() {
    logger.debug("Bean initialization: CustomEditorConfigurer");
    CustomEditorConfigurer configurer = new CustomEditorConfigurer();
    Map<Class<?>, Class<? extends PropertyEditor>> customEditors;
    customEditors = new HashMap<>();
    customEditors.put(java.io.Reader.class,
            net.przemkovv.sphinx.web.util.ServletContextResourceReaderPropertyEditor.class);
    configurer.setCustomEditors(customEditors);
    return configurer;
}