Example usage for org.springframework.core.convert.support ConfigurableConversionService addConverter

List of usage examples for org.springframework.core.convert.support ConfigurableConversionService addConverter

Introduction

In this page you can find the example usage for org.springframework.core.convert.support ConfigurableConversionService addConverter.

Prototype

void addConverter(Converter<?, ?> converter);

Source Link

Document

Add a plain converter to this registry.

Usage

From source file:org.socialsignin.springframework.data.dynamodb.demo.config.DemoRestMvcConfiguration.java

@Override
protected void configureConversionService(ConfigurableConversionService conversionService) {
    conversionService.addConverter(stringToThreadIdConverter());
    conversionService.addConverter(stringToReplyIdConverter());
    super.configureConversionService(conversionService);
}

From source file:example.app.web.RepositoryExampleRestWebApplication.java

@Bean
RepositoryRestConfigurer repositoryRestConfigurer() {
    return new RepositoryRestConfigurerAdapter() {
        @Override/*from  w w w .  ja va 2s.  co m*/
        public void configureJacksonObjectMapper(ObjectMapper objectMapper) {
            super.configureJacksonObjectMapper(objectMapper);
            LocalDateDeserializer.register(objectMapper);
        }

        @Override
        public void configureConversionService(ConfigurableConversionService conversionService) {
            super.configureConversionService(conversionService);
            conversionService.addConverter(StringToPhoneNumberConverter.INSTANCE);
        }
    };
}