Class OfficeFloorRestAutoConfiguration

java.lang.Object
net.officefloor.spring.starter.rest.OfficeFloorRestAutoConfiguration

@AutoConfiguration @EnableConfigurationProperties(OfficeFloorRestProperties.class) @ConditionalOnProperty(prefix="officefloor.rest", name="enabled", havingValue="true", matchIfMissing=true) public class OfficeFloorRestAutoConfiguration extends Object
Auto-configuration for OfficeFloor REST integration.
  • Constructor Details

    • OfficeFloorRestAutoConfiguration

      public OfficeFloorRestAutoConfiguration()
  • Method Details

    • officefloorJacksonObjectMapper

      @Bean @ConditionalOnMissingBean(tools.jackson.databind.ObjectMapper.class) public tools.jackson.databind.ObjectMapper officefloorJacksonObjectMapper()
      Fallback ObjectMapper bean where Jackson 3.x is not auto-configured. In SB4 this bean is never created because Spring Boot 4 auto-configures tools.jackson.databind.ObjectMapper via its Jackson auto-configuration. Uses findAndRegisterModules() so ServiceLoader-registered modules are picked up.
      Returns:
      ObjectMapper.
    • kotlinJacksonModule

      @Bean @ConditionalOnMissingBean(name="kotlinJacksonModule") @ConditionalOnClass(name="tools.jackson.module.kotlin.KotlinModule") public tools.jackson.databind.JacksonModule kotlinJacksonModule() throws Exception
      Registers a KotlinModule bean when jackson-module-kotlin is on the classpath. Installs Kotlin support on the OfficeFloor Jackson 3.x ObjectMapper, which is required for Jackson to deserialize Kotlin data classes (which have no no-arg constructor).
      Returns:
      JacksonModule wrapping KotlinModule.
      Throws:
      Exception - if reflection fails.
    • getOfficeFloorRestSpringBootStarter

      @Bean @ConditionalOnMissingBean public OfficeFloorRestSpringBootStarter getOfficeFloorRestSpringBootStarter(OfficeFloorRestProperties properties, org.springframework.context.ConfigurableApplicationContext applicationContext, tools.jackson.databind.ObjectMapper mapper)
      Parameters:
      properties - OfficeFloorRestProperties.
      applicationContext - ConfigurableApplicationContext.
      mapper - ObjectMapper.
      Returns:
      OfficeFloorRestSpringBootStarter.
    • officeFloorWebMvcConfigurer

      @Bean public OfficeFloorWebMvcConfigurer officeFloorWebMvcConfigurer(OfficeFloorRestSpringBootStarter starter, org.springframework.beans.factory.ObjectProvider<org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter> handlerAdapterProvider, org.springframework.beans.factory.ObjectProvider<org.springframework.web.servlet.DispatcherServlet> dispatcherServletProvider, org.springframework.beans.factory.ObjectProvider<org.springframework.context.ApplicationContext> applicationContextProvider) throws Exception
      Provides the OfficeFloorWebMvcConfigurer bean.
      Parameters:
      starter - OfficeFloorRestSpringBootStarter.
      handlerAdapterProvider - ObjectProvider for RequestMappingHandlerAdapter.
      dispatcherServletProvider - ObjectProvider for DispatcherServlet.
      applicationContextProvider - ObjectProvider for ApplicationContext.
      Returns:
      OfficeFloorWebMvcConfigurer.
      Throws:
      Exception - If fails to create the configurer.