org.macrocloud.kernel.toolkit.config.ConverterConfiguration Maven / Gradle / Ivy
package org.macrocloud.kernel.toolkit.config;
import org.macrocloud.kernel.toolkit.convert.EnumToStringConverter;
import org.macrocloud.kernel.toolkit.convert.StringToEnumConverter;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* String 转换配置.
*/
@Configuration(proxyBeanMethods = false)
public class ConverterConfiguration implements WebMvcConfigurer {
/**
* Title: addFormatters
* Description:
.
*
* @param registry the registry
* @see org.springframework.web.servlet.config.annotation.WebMvcConfigurer#addFormatters(org.springframework.format.FormatterRegistry)
*/
@Override
public void addFormatters(FormatterRegistry registry) {
registry.addConverter(new EnumToStringConverter());
registry.addConverter(new StringToEnumConverter());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy