org.springframework.binding.convert.service.DefaultConversionService Java Examples

The following examples show how to use org.springframework.binding.convert.service.DefaultConversionService. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SpringletsWebFlowConfiguration.java    From springlets with Apache License 2.0 5 votes vote down vote up
/**
 * Creates the {@link FlowBuilderServices} and configures it as follows:
 * 
 * * Set the WebFlow {@link org.springframework.binding.convert.ConversionService} 
 *   that delegates on the default Spring MVC {@link ConversionService}.
 * * Set the default Spring MVC {@link Validator} as the default Spring WebFlow Validator.
 * * Register the {@link StringToNullConverter}.
 * * Enable/disable flow and views cache (cache enabled by default).
 * * View factories creator that resolve their views by loading flow-relative resources.
 * 
 * @return the FlowBuilderServices
 */
@Bean
public FlowBuilderServices flowBuilderServices() {

  DefaultConversionService webFlowConversionService =
      new DefaultConversionService(this.conversionService);

  webFlowConversionService.addConverter(new StringToNullConverter());

  return getFlowBuilderServicesBuilder().setViewFactoryCreator(mvcViewFactoryCreator())
      .setConversionService(webFlowConversionService).setValidator(this.validator)
      .setDevelopmentMode(!this.development).build();
}