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

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

Introduction

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

Prototype

public void setPropertyEditorRegistrars(PropertyEditorRegistrar[] propertyEditorRegistrars) 

Source Link

Document

Specify the PropertyEditorRegistrar PropertyEditorRegistrars to apply to beans defined within the current application context.

Usage

From source file:org.echocat.jomon.spring.BaseConfiguration.java

@Bean(name = "customEditorConfigurer")
public static CustomEditorConfigurer customEditorConfigurer() throws Exception {
    final CustomEditorConfigurer result = new CustomEditorConfigurer();
    result.setPropertyEditorRegistrars(new PropertyEditorRegistrar[] { new BasePropertyEditorRegistrar() });
    return result;
}

From source file:org.web4thejob.context.ContextUtil.java

public static SessionContext getSessionContext() {
    SessionContext sessionContext = rootContext.getBean(SessionContext.class);
    if (!sessionContext.isActive()) {

        //SettingEnum PropertyEditor registration
        CustomEditorConfigurer customEditorConfigurer = new CustomEditorConfigurer();
        customEditorConfigurer
                .setPropertyEditorRegistrars(new PropertyEditorRegistrar[] { new CustomEditorRegistrar() });
        sessionContext.addBeanFactoryPostProcessor(customEditorConfigurer);

        sessionContext.refresh();//from w ww.  ja va2 s.co m
        BeanPostProcessor beanPostProcessor = ContextUtil.getBean(AuthorizationBeanPostProcessor.class);
        if (beanPostProcessor != null) {
            sessionContext.getBeanFactory().addBeanPostProcessor(beanPostProcessor);
        }
    }
    return sessionContext;
}