@Configuration(proxyBeanMethods=false) @EnableHypermediaSupport(type={HAL,HAL_FORMS}) @Import(value={org.springframework.data.rest.webmvc.config.RestControllerImportSelector.class,org.springframework.data.web.config.SpringDataJacksonConfiguration.class,org.springframework.data.web.config.EnableSpringDataWebSupport.QuerydslActivator.class}) public class RepositoryRestMvcConfiguration extends HateoasAwareSpringDataWebConfiguration implements BeanClassLoaderAware
Any XML files located in the classpath under the META-INF/spring-data-rest/ path will be automatically
found and loaded into this ApplicationContext.
| Constructor and Description |
|---|
RepositoryRestMvcConfiguration(ApplicationContext context,
ObjectFactory<ConversionService> conversionService,
ObjectProvider<org.springframework.hateoas.server.LinkRelationProvider> relProvider,
ObjectProvider<org.springframework.hateoas.mediatype.hal.CurieProvider> curieProvider,
ObjectProvider<org.springframework.hateoas.mediatype.hal.HalConfiguration> halConfiguration,
ObjectProvider<com.fasterxml.jackson.databind.ObjectMapper> objectMapper,
ObjectProvider<org.springframework.hateoas.server.mvc.RepresentationModelProcessorInvoker> invoker,
ObjectProvider<org.springframework.hateoas.mediatype.MessageResolver> resolver,
ObjectProvider<GeoModule> geoModule,
ObjectProvider<PathPatternParser> parser) |
addArgumentResolvers, pagedResourcesAssembler, pagedResourcesAssemblerArgumentResolveraddFormatters, customizePageableResolver, customizeSortResolver, extendMessageConvertersclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddCorsMappings, addInterceptors, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, getMessageCodesResolver, getValidatorpublic RepositoryRestMvcConfiguration(ApplicationContext context, @Qualifier(value="mvcConversionService") ObjectFactory<ConversionService> conversionService, ObjectProvider<org.springframework.hateoas.server.LinkRelationProvider> relProvider, ObjectProvider<org.springframework.hateoas.mediatype.hal.CurieProvider> curieProvider, ObjectProvider<org.springframework.hateoas.mediatype.hal.HalConfiguration> halConfiguration, ObjectProvider<com.fasterxml.jackson.databind.ObjectMapper> objectMapper, ObjectProvider<org.springframework.hateoas.server.mvc.RepresentationModelProcessorInvoker> invoker, ObjectProvider<org.springframework.hateoas.mediatype.MessageResolver> resolver, ObjectProvider<GeoModule> geoModule, ObjectProvider<PathPatternParser> parser)
public void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader in interface BeanClassLoaderAwaresetBeanClassLoader in class SpringDataWebConfiguration@Bean public Repositories repositories()
@Bean public RepositoryRelProvider repositoryRelProvider(ObjectFactory<ResourceMappings> resourceMappings)
@Bean public PersistentEntities persistentEntities()
@Bean @Qualifier public DefaultFormattingConversionService defaultConversionService(PersistentEntities persistentEntities, RepositoryInvokerFactory repositoryInvokerFactory, Repositories repositories)
@Bean public ValidatingRepositoryEventListener validatingRepositoryEventListener(ObjectFactory<PersistentEntities> entities)
ApplicationListener implementation for invoking
Validator instances assigned to specific domain types.@Bean public <T extends RepositoryRestConfiguration & CorsConfigurationAware> T repositoryRestConfiguration()
@Bean public static ProjectionDefinitionRegistar projectionDefinitionRegistrar(ObjectFactory<RepositoryRestConfiguration> config)
@Bean public MetadataConfiguration metadataConfiguration()
@Bean public BaseUri baseUri(RepositoryRestConfiguration repositoryRestConfiguration)
@Bean public static AnnotatedEventHandlerInvoker annotatedEventHandlerInvoker()
@Bean public ServerHttpRequestMethodArgumentResolver serverHttpRequestMethodArgumentResolver()
HttpServletRequest into a ServerHttpRequest.@Bean public RootResourceInformationHandlerMethodArgumentResolver repoRequestArgumentResolver(Repositories repositories, ResourceMetadataHandlerMethodArgumentResolver resourceMetadataHandlerMethodArgumentResolver, @Qualifier RepositoryInvokerFactory repositoryInvokerFactory)
@Bean public ResourceMetadataHandlerMethodArgumentResolver resourceMetadataHandlerMethodArgumentResolver(Repositories repositories, RepositoryResourceMappings resourceMappings, BaseUri baseUri)
@Bean public BackendIdHandlerMethodArgumentResolver backendIdHandlerMethodArgumentResolver(org.springframework.plugin.core.PluginRegistry<BackendIdConverter,Class<?>> backendIdConverterRegistry, ResourceMetadataHandlerMethodArgumentResolver resourceMetadataHandlerMethodArgumentResolver, BaseUri baseUri)
@Bean public ETagArgumentResolver eTagArgumentResolver()
@Bean public RepositoryEntityLinks entityLinks(ObjectFactory<HateoasPageableHandlerMethodArgumentResolver> pageableResolver, Repositories repositories, RepositoryResourceMappings resourceMappings, org.springframework.plugin.core.PluginRegistry<BackendIdConverter,Class<?>> backendIdConverterRegistry, RepositoryRestConfiguration repositoryRestConfiguration, ObjectFactory<HateoasSortHandlerMethodArgumentResolver> sortResolver)
EntityLinks implementation that takes repository and current
configuration into account when generating links.@Bean public PersistentEntityResourceHandlerMethodArgumentResolver persistentEntityArgumentResolver(@Qualifier(value="defaultMessageConverters") List<HttpMessageConverter<?>> defaultMessageConverters, RootResourceInformationHandlerMethodArgumentResolver repoRequestArgumentResolver, Associations associationLinks, BackendIdHandlerMethodArgumentResolver backendIdHandlerMethodArgumentResolver, PersistentEntities persistentEntities)
@Bean public PersistentEntityToJsonSchemaConverter jsonSchemaConverter(PersistentEntities persistentEntities, Associations associationLinks, @Qualifier RepositoryInvokerFactory repositoryInvokerFactory, RepositoryRestConfiguration repositoryRestConfiguration)
JsonSchema.public com.fasterxml.jackson.databind.ObjectMapper objectMapper()
ObjectMapper used internally.@Bean public org.springframework.hateoas.server.mvc.TypeConstrainedMappingJackson2HttpMessageConverter jacksonHttpMessageConverter(RepositoryRestConfiguration repositoryRestConfiguration)
HttpMessageConverter used by Spring MVC to read and write JSON data.@Bean public org.springframework.hateoas.server.mvc.TypeConstrainedMappingJackson2HttpMessageConverter halJacksonHttpMessageConverter(LinkCollector linkCollector, RepositoryRestConfiguration repositoryRestConfiguration)
public com.fasterxml.jackson.databind.ObjectMapper halObjectMapper(LinkCollector linkCollector)
@Bean public UriListHttpMessageConverter uriListHttpMessageConverter()
HttpMessageConverter used to create text/uri-list responses.@Bean public RequestMappingHandlerAdapter repositoryExporterHandlerAdapter(@Qualifier(value="defaultMessageConverters") List<HttpMessageConverter<?>> defaultMessageConverters, AlpsJsonHttpMessageConverter alpsJsonHttpMessageConverter, SelfLinkProvider selfLinkProvider, PersistentEntityResourceHandlerMethodArgumentResolver persistentEntityArgumentResolver, RootResourceInformationHandlerMethodArgumentResolver repoRequestArgumentResolver, RepositoryRestConfiguration repositoryRestConfiguration)
HandlerAdapter that only recognizes handler methods defined in the
provided controller classes.@Bean public org.springframework.data.rest.webmvc.config.DelegatingHandlerMapping restHandlerMapping(Repositories repositories, RepositoryResourceMappings resourceMappings, Optional<JpaHelper> jpaHelper, RepositoryRestConfiguration repositoryRestConfiguration, CorsConfigurationAware corsRestConfiguration)
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. See DATAREST-490.@Bean public RepositoryResourceMappings resourceMappings(Repositories repositories, PersistentEntities persistentEntities, RepositoryRestConfiguration repositoryRestConfiguration)
protected com.fasterxml.jackson.databind.Module persistentEntityJackson2Module(LinkCollector linkCollector)
@Bean protected LinkCollector linkCollector(PersistentEntities persistentEntities, SelfLinkProvider selfLinkProvider, Associations associationLinks)
@Bean public ExcerptProjector excerptProjector(RepositoryResourceMappings resourceMappings)
public void extendHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers)
extendHandlerExceptionResolvers in interface WebMvcConfigurer@Bean public RepositoryRestExceptionHandler repositoryRestExceptionHandler()
@Bean @Qualifier public RepositoryInvokerFactory repositoryInvokerFactory()
@Bean public List<HttpMessageConverter<?>> defaultMessageConverters(@Qualifier(value="jacksonHttpMessageConverter") org.springframework.hateoas.server.mvc.TypeConstrainedMappingJackson2HttpMessageConverter jacksonHttpMessageConverter, @Qualifier(value="halJacksonHttpMessageConverter") org.springframework.hateoas.server.mvc.TypeConstrainedMappingJackson2HttpMessageConverter halJacksonHttpMessageConverter, @Qualifier(value="halFormsJacksonHttpMessageConverter") org.springframework.hateoas.server.mvc.TypeConstrainedMappingJackson2HttpMessageConverter halFormsJacksonHttpMessageConverter, AlpsJsonHttpMessageConverter alpsJsonHttpMessageConverter, UriListHttpMessageConverter uriListHttpMessageConverter, RepositoryRestConfiguration repositoryRestConfiguration)
@Bean public AlpsJsonHttpMessageConverter alpsJsonHttpMessageConverter(RootResourceInformationToAlpsDescriptorConverter alpsConverter)
@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(List<BackendIdConverter> backendIdConverter)
@Bean public AuditableBeanWrapperFactory auditableBeanWrapperFactory(PersistentEntities persistentEntities)
@Bean public HttpHeadersPreparer httpHeadersPreparer(AuditableBeanWrapperFactory auditableBeanWrapperFactory)
@Bean public SelfLinkProvider selfLinkProvider(PersistentEntities persistentEntities, RepositoryEntityLinks entityLinks, @Qualifier(value="mvcConversionService") ObjectProvider<ConversionService> conversionService)
@Bean public Associations associationLinks(RepositoryResourceMappings resourceMappings, RepositoryRestConfiguration repositoryRestConfiguration)
protected List<EntityLookup<?>> getEntityLookups()
protected List<HandlerMethodArgumentResolver> defaultMethodArgumentResolvers(SelfLinkProvider selfLinkProvider, PersistentEntityResourceHandlerMethodArgumentResolver persistentEntityArgumentResolver, RootResourceInformationHandlerMethodArgumentResolver repoRequestArgumentResolver)
protected com.fasterxml.jackson.databind.ObjectMapper basicObjectMapper()
@Bean public EnumTranslator enumTranslator(org.springframework.hateoas.mediatype.MessageResolver resolver)
@Bean public RootResourceInformationToAlpsDescriptorConverter alpsConverter(Repositories repositories, PersistentEntities persistentEntities, RepositoryEntityLinks entityLinks, EnumTranslator enumTranslator, Associations associationLinks, RepositoryRestConfiguration repositoryRestConfiguration)
@Bean public ProfileResourceProcessor profileResourceProcessor(RepositoryRestConfiguration repositoryRestConfiguration)
public void addResourceHandlers(ResourceHandlerRegistry registry)
addResourceHandlers in interface WebMvcConfigurerCopyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.