Example usage for org.springframework.format.support FormattingConversionServiceFactoryBean FormattingConversionServiceFactoryBean

List of usage examples for org.springframework.format.support FormattingConversionServiceFactoryBean FormattingConversionServiceFactoryBean

Introduction

In this page you can find the example usage for org.springframework.format.support FormattingConversionServiceFactoryBean FormattingConversionServiceFactoryBean.

Prototype

FormattingConversionServiceFactoryBean

Source Link

Usage

From source file:com.iflytek.edu.cloud.frame.spring.RequestMappingHandlerAdapterFactoryBean.java

@Override
public void afterPropertiesSet() throws Exception {
    handlerAdapter = new RequestMappingHandlerAdapter();
    handlerAdapter.setArgumentResolvers(getDefaultArgumentResolvers());
    handlerAdapter.setInitBinderArgumentResolvers(getDefaultInitBinderArgumentResolvers());
    handlerAdapter.setReturnValueHandlers(getDefaultReturnValueHandlers());

    ConfigurableWebBindingInitializer webBindingInitializer = new ConfigurableWebBindingInitializer();
    FormattingConversionServiceFactoryBean conversionServiceFactoryBean = new FormattingConversionServiceFactoryBean();
    conversionServiceFactoryBean.afterPropertiesSet();
    webBindingInitializer.setConversionService(conversionServiceFactoryBean.getObject());

    OptionalValidatorFactoryBean validatorFactoryBean = new OptionalValidatorFactoryBean();
    validatorFactoryBean.afterPropertiesSet();
    webBindingInitializer.setValidator(validatorFactoryBean);

    handlerAdapter.setWebBindingInitializer(webBindingInitializer);
    handlerAdapter.setApplicationContext(applicationContext);
    handlerAdapter.afterPropertiesSet();
}

From source file:com.yunkouan.lpid.atmosphere.config.WebAppConfiguration.java

/**
 * Spring?Bean/*  w  ww  .j a  v a  2s  .co  m*/
 * 
 * @return 
 * @since 1.0.0
 * 201493-?1:46:14
 */
@Bean
public FormattingConversionServiceFactoryBean conversionService() {
    FormattingConversionServiceFactoryBean conversionService = new FormattingConversionServiceFactoryBean();
    Set<Converter> conversionSet = new HashSet<Converter>();
    //String
    //        conversionSet.add(new StringToEnumConverterFactory().getConverter(ImageHandleMode.class));

    return conversionService;
}