All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.katharsis.spring.boot.ModuleConfiguration Maven / Gradle / Ivy

There is a newer version: 3.0.2
Show newest version
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