Interface RepositoryRestConfigurer
public interface RepositoryRestConfigurer
Component to configure and customize the setup of Spring Data REST.
- Since:
- 2.4
- Author:
- Oliver Gierke
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
configureConversionService
(org.springframework.core.convert.support.ConfigurableConversionService conversionService) Override this method to add your own converters.default void
configureExceptionHandlerExceptionResolver
(org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver exceptionResolver) Configure theExceptionHandlerExceptionResolver
.default void
configureHttpMessageConverters
(List<org.springframework.http.converter.HttpMessageConverter<?>> messageConverters) Configure the availableHttpMessageConverter
s by adding your own.default void
configureJacksonObjectMapper
(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Configure the JacksonObjectMapper
directly.default void
configureRepositoryRestConfiguration
(RepositoryRestConfiguration config, org.springframework.web.servlet.config.annotation.CorsRegistry cors) Override this method to add additional configuration.default void
configureValidatingRepositoryEventListener
(ValidatingRepositoryEventListener validatingListener) Override this method to add validators manually.default org.springframework.data.auditing.AuditableBeanWrapperFactory
customizeAuditableBeanWrapperFactory
(org.springframework.data.auditing.AuditableBeanWrapperFactory factory) Customize theAuditableBeanWrapperFactory
to be used.default LinkCollector
customizeLinkCollector
(LinkCollector collector) Customize theLinkCollector
to be used.static RepositoryRestConfigurer
withConfig
(BiConsumer<RepositoryRestConfiguration, org.springframework.web.servlet.config.annotation.CorsRegistry> consumer) Convenience method to easily create simpleRepositoryRestConfigurer
instances that solely want to tweak theRepositoryRestConfiguration
.static RepositoryRestConfigurer
withConfig
(Consumer<RepositoryRestConfiguration> consumer) Convenience method to easily create simpleRepositoryRestConfigurer
instances that solely want to tweak theRepositoryRestConfiguration
.
-
Method Details
-
withConfig
Convenience method to easily create simpleRepositoryRestConfigurer
instances that solely want to tweak theRepositoryRestConfiguration
.- Parameters:
consumer
- must not be null.- Returns:
- Since:
- 3.1
-
withConfig
static RepositoryRestConfigurer withConfig(BiConsumer<RepositoryRestConfiguration, org.springframework.web.servlet.config.annotation.CorsRegistry> consumer) Convenience method to easily create simpleRepositoryRestConfigurer
instances that solely want to tweak theRepositoryRestConfiguration
.- Parameters:
consumer
- must not be null.- Returns:
- Since:
- 3.4
-
configureRepositoryRestConfiguration
default void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, org.springframework.web.servlet.config.annotation.CorsRegistry cors) Override this method to add additional configuration.- Parameters:
config
- Main configuration bean.cors
- CORS configuration.- Since:
- 3.4
-
configureConversionService
default void configureConversionService(org.springframework.core.convert.support.ConfigurableConversionService conversionService) Override this method to add your own converters.- Parameters:
conversionService
- Default ConversionService bean.
-
configureValidatingRepositoryEventListener
default void configureValidatingRepositoryEventListener(ValidatingRepositoryEventListener validatingListener) Override this method to add validators manually.- Parameters:
validatingListener
- TheApplicationListener
responsible for invokingValidator
instances.
-
configureExceptionHandlerExceptionResolver
default void configureExceptionHandlerExceptionResolver(org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver exceptionResolver) Configure theExceptionHandlerExceptionResolver
.- Parameters:
exceptionResolver
- The default exception resolver on which you can add custom argument resolvers.
-
configureHttpMessageConverters
default void configureHttpMessageConverters(List<org.springframework.http.converter.HttpMessageConverter<?>> messageConverters) Configure the availableHttpMessageConverter
s by adding your own.- Parameters:
messageConverters
- The converters to be used by the system.
-
configureJacksonObjectMapper
default void configureJacksonObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Configure the JacksonObjectMapper
directly.- Parameters:
objectMapper
- The ObjectMapper to be used by the system.
-
customizeAuditableBeanWrapperFactory
default org.springframework.data.auditing.AuditableBeanWrapperFactory customizeAuditableBeanWrapperFactory(org.springframework.data.auditing.AuditableBeanWrapperFactory factory) Customize theAuditableBeanWrapperFactory
to be used.- Parameters:
factory
- will never be null.- Returns:
- must not be null.
- Since:
- 3.5
-
customizeLinkCollector
Customize theLinkCollector
to be used.- Parameters:
collector
- will never be null.- Returns:
- must not be null.
- Since:
- 3.5
-