io.katharsis.spring.boot.ModuleConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of katharsis-spring Show documentation
Show all versions of katharsis-spring Show documentation
Katharsis Spring integration
package io.katharsis.spring.boot;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.katharsis.module.CoreModule;
import io.katharsis.module.ModuleRegistry;
import io.katharsis.resource.field.ResourceFieldNameTransformer;
@Configuration
public class ModuleConfiguration {
@Autowired
private KatharsisSpringBootProperties properties;
@Autowired
private ObjectMapper objectMapper;
@Bean
public ModuleRegistry moduleRegistry() {
ResourceFieldNameTransformer resourceFieldNameTransformer = new ResourceFieldNameTransformer(
objectMapper.getSerializationConfig());
ModuleRegistry registry = new ModuleRegistry();
String resourceSearchPackage = properties.getResourcePackage();
registry.addModule(new CoreModule(resourceSearchPackage, resourceFieldNameTransformer));
return registry;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy