@Configuration @EnableHypermediaSupport(type=HAL) @ComponentScan(basePackageClasses=RepositoryRestController.class, includeFilters=, useDefaultFilters=false) @ImportResource(value="classpath*:META-INF/spring-data-rest/**/*.xml") @Import(value={org.springframework.data.web.config.SpringDataJacksonConfiguration.class,org.springframework.data.web.config.EnableSpringDataWebSupport.QuerydslActivator.class}) public class RepositoryRestMvcConfiguration extends HateoasAwareSpringDataWebConfiguration implements InitializingBean
ApplicationContext
.Constructor and Description |
---|
RepositoryRestMvcConfiguration() |
addArgumentResolvers, pagedResourcesAssembler, pagedResourcesAssemblerArgumentResolver
addFormatters
addInterceptors, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendMessageConverters, getMessageCodesResolver, getValidator
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
@Bean public Repositories repositories()
@Bean public RepositoryRelProvider repositoryRelProvider(ObjectFactory<ResourceMappings> resourceMappings)
@Bean public PersistentEntities persistentEntities()
@Bean @Qualifier public DefaultFormattingConversionService defaultConversionService()
@Bean public ValidatingRepositoryEventListener validatingRepositoryEventListener(ObjectFactory<Repositories> repositories)
ApplicationListener
implementation for invoking
Validator
instances assigned to specific domain types.@Bean public RepositoryRestConfiguration config()
@Bean public MetadataConfiguration metadataConfiguration()
@Bean public static AnnotatedEventHandlerInvoker annotatedEventHandlerInvoker()
BeanPostProcessor
to turn beans annotated as
org.springframework.data.rest.repository.annotation.RepositoryEventHandler
s.@Bean public DomainObjectMerger domainObjectMerger() throws Exception
Exception
@Bean public ServerHttpRequestMethodArgumentResolver serverHttpRequestMethodArgumentResolver()
HttpServletRequest
into a
ServerHttpRequest
.@Bean public RootResourceInformationHandlerMethodArgumentResolver repoRequestArgumentResolver()
@Bean public ResourceMetadataHandlerMethodArgumentResolver resourceMetadataHandlerMethodArgumentResolver()
@Bean public BackendIdHandlerMethodArgumentResolver backendIdHandlerMethodArgumentResolver()
@Bean public ETagArgumentResolver eTagArgumentResolver()
@Bean public RepositoryEntityLinks entityLinks()
EntityLinks
implementation that takes repository and current
configuration into account when generating links.Exception
@Bean public PersistentEntityResourceHandlerMethodArgumentResolver persistentEntityArgumentResolver()
@Bean public PersistentEntityToJsonSchemaConverter jsonSchemaConverter()
JsonSchema
.@Bean public MessageSourceAccessor resourceDescriptionMessageSourceAccessor()
MessageSourceAccessor
to provide messages for ResourceDescription
s being rendered.@Bean public com.fasterxml.jackson.databind.ObjectMapper objectMapper()
ObjectMapper
used internally.@Bean public org.springframework.hateoas.mvc.TypeConstrainedMappingJackson2HttpMessageConverter jacksonHttpMessageConverter()
HttpMessageConverter
used by Spring MVC to read and write JSON data.@Bean public org.springframework.hateoas.mvc.TypeConstrainedMappingJackson2HttpMessageConverter halJacksonHttpMessageConverter()
@Bean public com.fasterxml.jackson.databind.ObjectMapper halObjectMapper()
@Bean public UriListHttpMessageConverter uriListHttpMessageConverter()
HttpMessageConverter
used to create text/uri-list responses.@Bean public RequestMappingHandlerAdapter repositoryExporterHandlerAdapter()
HandlerAdapter
that only recognizes handler methods defined in the
provided controller classes.resourceProcessors
- ResourceProcessor
s available in the ApplicationContext
.@Bean public DelegatingHandlerMapping restHandlerMapping()
HandlerMapping
to delegate requests to Spring Data REST controllers. Sets up a
DelegatingHandlerMapping
to make sure manually implemented BasePathAwareController
instances that
register custom handlers for certain media types don't cause the RepositoryRestHandlerMapping
to be
omitted.DATAREST-490
@Bean public ResourceMappings resourceMappings()
protected com.fasterxml.jackson.databind.Module persistentEntityJackson2Module()
protected UriToEntityConverter uriToEntityConverter(ConversionService conversionService)
entities
- @Bean public ExceptionHandlerExceptionResolver exceptionHandlerExceptionResolver()
ExceptionHandler
.@Bean public RepositoryRestExceptionHandler repositoryRestExceptionHandler()
@Bean public RepositoryInvokerFactory repositoryInvokerFactory()
@Bean public List<HttpMessageConverter<?>> defaultMessageConverters()
@Bean public AlpsJsonHttpMessageConverter alpsJsonHttpMessageConverter()
@Bean public HateoasPageableHandlerMethodArgumentResolver pageableResolver()
pageableResolver
in class HateoasAwareSpringDataWebConfiguration
@Bean public HateoasSortHandlerMethodArgumentResolver sortResolver()
sortResolver
in class HateoasAwareSpringDataWebConfiguration
@Bean public org.springframework.plugin.core.PluginRegistry<BackendIdConverter,Class<?>> backendIdConverterRegistry()
@Bean public AuditableBeanWrapperFactory auditableBeanWrapperFactory()
protected List<HandlerMethodArgumentResolver> defaultMethodArgumentResolvers()
protected com.fasterxml.jackson.databind.ObjectMapper basicObjectMapper()
@Bean public EnumTranslator enumTranslator()
@Bean public RootResourceInformationToAlpsDescriptorConverter alpsConverter()
@Bean public ProfileResourceProcessor profileResourceProcessor(RepositoryRestConfiguration config)
public void addResourceHandlers(ResourceHandlerRegistry registry)
addResourceHandlers
in interface WebMvcConfigurer
addResourceHandlers
in class WebMvcConfigurerAdapter
@Deprecated protected void configureRepositoryRestConfiguration(RepositoryRestConfiguration config)
RepositoryRestConfigurer.configureRepositoryRestConfiguration(RepositoryRestConfiguration)
either directly or extend RepositoryRestConfigurerAdapter
and override the method.config
- Main configuration bean.@Deprecated protected void configureConversionService(ConfigurableConversionService conversionService)
RepositoryRestConfigurer.configureConversionService(ConfigurableConversionService)
either
directly or extend RepositoryRestConfigurerAdapter
and override the method.conversionService
- Default ConversionService bean.@Deprecated protected void configureValidatingRepositoryEventListener(ValidatingRepositoryEventListener validatingListener)
RepositoryRestConfigurer.configureValidatingRepositoryEventListener(ValidatingRepositoryEventListener)
either directly or extend RepositoryRestConfigurerAdapter
and override the method.validatingListener
- The ApplicationListener
responsible for invoking
Validator
instances.@Deprecated protected void configureExceptionHandlerExceptionResolver(ExceptionHandlerExceptionResolver exceptionResolver)
RepositoryRestConfigurer.configureExceptionHandlerExceptionResolver(ExceptionHandlerExceptionResolver)
either directly or extend RepositoryRestConfigurerAdapter
and override the method.ExceptionHandlerExceptionResolver
.exceptionResolver
- The default exception resolver on which you can add custom argument resolvers.@Deprecated protected void configureHttpMessageConverters(List<HttpMessageConverter<?>> messageConverters)
RepositoryRestConfigurer.configureHttpMessageConverters(List)
either
directly or extend RepositoryRestConfigurerAdapter
and override the method.HttpMessageConverter
s by adding your own.messageConverters
- The converters to be used by the system.@Deprecated protected void configureJacksonObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
RepositoryRestConfigurer.configureJacksonObjectMapper(ObjectMapper)
either
directly or extend RepositoryRestConfigurerAdapter
and override the method.ObjectMapper
directly.objectMapper
- The ObjectMapper to be used by the system.Copyright © 2011-2015–2016 Pivotal Software, Inc.. All rights reserved.