Search in sources :

Example 1 with DomainClassConverter

use of org.springframework.data.repository.support.DomainClassConverter in project spring-data-commons by spring-projects.

the class SpringDataWebConfiguration method addFormatters.

/*
	 * (non-Javadoc)
	 * @see org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter#addFormatters(org.springframework.format.FormatterRegistry)
	 */
@Override
public void addFormatters(FormatterRegistry registry) {
    registry.addFormatter(DistanceFormatter.INSTANCE);
    registry.addFormatter(PointFormatter.INSTANCE);
    if (!(registry instanceof FormattingConversionService)) {
        return;
    }
    FormattingConversionService conversionService = (FormattingConversionService) registry;
    DomainClassConverter<FormattingConversionService> converter = new DomainClassConverter<>(conversionService);
    converter.setApplicationContext(context);
}
Also used : DomainClassConverter(org.springframework.data.repository.support.DomainClassConverter) FormattingConversionService(org.springframework.format.support.FormattingConversionService)

Aggregations

DomainClassConverter (org.springframework.data.repository.support.DomainClassConverter)1 FormattingConversionService (org.springframework.format.support.FormattingConversionService)1