Interface RepositoryRestConfigurer
public interface RepositoryRestConfigurer
Component to configure and customize the setup of Spring Data REST.
- Since:
- 2.4
- Author:
- Oliver Gierke, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidconfigureConversionService(ConfigurableConversionService conversionService) Override this method to add your own converters.default voidconfigureExceptionHandlerExceptionResolver(ExceptionHandlerExceptionResolver exceptionResolver) Configure theExceptionHandlerExceptionResolver.default voidconfigureHttpMessageConverters(List<HttpMessageConverter<?>> messageConverters) Configure the availableHttpMessageConverters by adding your own.default voidconfigureJacksonObjectMapper(tools.jackson.databind.cfg.MapperBuilder<? extends tools.jackson.databind.ObjectMapper, ? extends tools.jackson.databind.cfg.MapperBuilder<?, ?>> mapperBuilder) Configure the JacksonMapperBuilderdirectly.default voidOverride this method to add additional configuration.default voidconfigureValidatingRepositoryEventListener(ValidatingRepositoryEventListener validatingListener) Override this method to add validators manually.default AuditableBeanWrapperFactoryCustomize theAuditableBeanWrapperFactoryto be used.default LinkCollectorcustomizeLinkCollector(LinkCollector collector) Customize theLinkCollectorto be used.static RepositoryRestConfigurerwithConfig(BiConsumer<RepositoryRestConfiguration, CorsRegistry> consumer) Convenience method to easily create simpleRepositoryRestConfigurerinstances that solely want to tweak theRepositoryRestConfiguration.static RepositoryRestConfigurerwithConfig(Consumer<RepositoryRestConfiguration> consumer) Convenience method to easily create simpleRepositoryRestConfigurerinstances that solely want to tweak theRepositoryRestConfiguration.
-
Method Details
-
withConfig
Convenience method to easily create simpleRepositoryRestConfigurerinstances that solely want to tweak theRepositoryRestConfiguration.- Parameters:
consumer- must not be null.- Returns:
- Since:
- 3.1
-
withConfig
static RepositoryRestConfigurer withConfig(BiConsumer<RepositoryRestConfiguration, CorsRegistry> consumer) Convenience method to easily create simpleRepositoryRestConfigurerinstances that solely want to tweak theRepositoryRestConfiguration.- Parameters:
consumer- must not be null.- Returns:
- Since:
- 3.4
-
configureRepositoryRestConfiguration
default void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) Override this method to add additional configuration.- Parameters:
config- Main configuration bean.cors- CORS configuration.- Since:
- 3.4
-
configureConversionService
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- theApplicationListenerresponsible for invokingValidatorinstances.
-
configureExceptionHandlerExceptionResolver
default void configureExceptionHandlerExceptionResolver(ExceptionHandlerExceptionResolver exceptionResolver) Configure theExceptionHandlerExceptionResolver.- Parameters:
exceptionResolver- the default exception resolver on which you can add custom argument resolvers.
-
configureHttpMessageConverters
Configure the availableHttpMessageConverters by adding your own.- Parameters:
messageConverters- the converters to be used by the system.
-
configureJacksonObjectMapper
default void configureJacksonObjectMapper(tools.jackson.databind.cfg.MapperBuilder<? extends tools.jackson.databind.ObjectMapper, ? extends tools.jackson.databind.cfg.MapperBuilder<?, ?>> mapperBuilder) Configure the JacksonMapperBuilderdirectly.- Parameters:
mapperBuilder- the mapper builder to configure.
-
customizeAuditableBeanWrapperFactory
default AuditableBeanWrapperFactory customizeAuditableBeanWrapperFactory(AuditableBeanWrapperFactory factory) Customize theAuditableBeanWrapperFactoryto be used.- Parameters:
factory- will never be null.- Returns:
- must not be null.
- Since:
- 3.5
-
customizeLinkCollector
Customize theLinkCollectorto be used.- Parameters:
collector- will never be null.- Returns:
- must not be null.
- Since:
- 3.5
-