public class RepositoryRestHandlerMapping extends BasePathAwareHandlerMapping
RequestMappingHandlerMapping implementation that will only find a handler method if a
Repository is exported under that URL path segment. Also ensures the
OpenEntityManagerInViewInterceptor is registered in the application context. The OEMIVI is required for the
REST exporter to function properly.| Constructor and Description |
|---|
RepositoryRestHandlerMapping(ResourceMappings mappings,
RepositoryRestConfiguration config)
Creates a new
RepositoryRestHandlerMapping for the given ResourceMappings and
RepositoryRestConfiguration. |
RepositoryRestHandlerMapping(ResourceMappings mappings,
RepositoryRestConfiguration config,
org.springframework.data.repository.support.Repositories repositories)
Creates a new
RepositoryRestHandlerMapping for the given ResourceMappings
RepositoryRestConfiguration and Repositories. |
| Modifier and Type | Method and Description |
|---|---|
protected org.springframework.web.servlet.mvc.condition.ProducesRequestCondition |
customize(org.springframework.web.servlet.mvc.condition.ProducesRequestCondition condition)
Customize the given
ProducesRequestCondition. |
protected void |
extendInterceptors(List<Object> interceptors) |
protected org.springframework.web.cors.CorsConfiguration |
getCorsConfiguration(Object handler,
javax.servlet.http.HttpServletRequest request) |
protected org.springframework.web.method.HandlerMethod |
handleNoMatch(Set<org.springframework.web.servlet.mvc.method.RequestMappingInfo> requestMappingInfos,
String lookupPath,
javax.servlet.http.HttpServletRequest request) |
protected boolean |
isHandler(Class<?> beanType) |
protected org.springframework.web.method.HandlerMethod |
lookupHandlerMethod(String lookupPath,
javax.servlet.http.HttpServletRequest request) |
void |
setEmbeddedValueResolver(org.springframework.util.StringValueResolver resolver) |
void |
setJpaHelper(JpaHelper jpaHelper) |
afterPropertiesSet, customize, getMappingForMethodcreateRequestMappingInfo, getContentNegotiationManager, getCustomMethodCondition, getCustomTypeCondition, getFileExtensions, initCorsConfiguration, match, resolveEmbeddedValuesInPatterns, setContentNegotiationManager, setUseRegisteredSuffixPatternMatch, setUseSuffixPatternMatch, setUseTrailingSlashMatch, useRegisteredSuffixPatternMatch, useSuffixPatternMatch, useTrailingSlashMatchgetMappingComparator, getMappingPathPatterns, getMatchingMapping, handleMatchcreateHandlerMethod, detectHandlerMethods, getHandlerInternal, getHandlerMethods, getHandlerMethodsForMappingName, getNamingStrategy, handlerMethodsInitialized, initHandlerMethods, registerHandlerMethod, registerMapping, setDetectHandlerMethodsInAncestorContexts, setHandlerMethodMappingNamingStrategy, unregisterMappingadaptInterceptor, detectMappedInterceptors, getAdaptedInterceptors, getCorsConfigurations, getCorsHandlerExecutionChain, getCorsProcessor, getDefaultHandler, getHandler, getHandlerExecutionChain, getMappedInterceptors, getOrder, getPathMatcher, getUrlPathHelper, initApplicationContext, initInterceptors, setAlwaysUseFullPath, setCorsConfigurations, setCorsProcessor, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelpergetServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextgetApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContextpublic RepositoryRestHandlerMapping(ResourceMappings mappings, RepositoryRestConfiguration config)
RepositoryRestHandlerMapping for the given ResourceMappings and
RepositoryRestConfiguration.mappings - must not be null.config - must not be null.public RepositoryRestHandlerMapping(ResourceMappings mappings, RepositoryRestConfiguration config, org.springframework.data.repository.support.Repositories repositories)
RepositoryRestHandlerMapping for the given ResourceMappings
RepositoryRestConfiguration and Repositories.mappings - must not be null.config - must not be null.repositories - can be null if CrossOrigin resolution is not required.public void setJpaHelper(JpaHelper jpaHelper)
jpaHelper - the jpaHelper to setpublic void setEmbeddedValueResolver(org.springframework.util.StringValueResolver resolver)
setEmbeddedValueResolver in interface org.springframework.context.EmbeddedValueResolverAwaresetEmbeddedValueResolver in class org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMappingprotected org.springframework.web.method.HandlerMethod lookupHandlerMethod(String lookupPath, javax.servlet.http.HttpServletRequest request) throws Exception
lookupHandlerMethod in class BasePathAwareHandlerMappingExceptionprotected org.springframework.web.method.HandlerMethod handleNoMatch(Set<org.springframework.web.servlet.mvc.method.RequestMappingInfo> requestMappingInfos, String lookupPath, javax.servlet.http.HttpServletRequest request) throws javax.servlet.ServletException
handleNoMatch in class org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMappingjavax.servlet.ServletExceptionprotected boolean isHandler(Class<?> beanType)
isHandler in class BasePathAwareHandlerMappingprotected void extendInterceptors(List<Object> interceptors)
extendInterceptors in class org.springframework.web.servlet.handler.AbstractHandlerMappingprotected org.springframework.web.servlet.mvc.condition.ProducesRequestCondition customize(org.springframework.web.servlet.mvc.condition.ProducesRequestCondition condition)
BasePathAwareHandlerMappingProducesRequestCondition. Default implementation returns the condition as is.customize in class BasePathAwareHandlerMappingcondition - will never be null.protected org.springframework.web.cors.CorsConfiguration getCorsConfiguration(Object handler, javax.servlet.http.HttpServletRequest request)
getCorsConfiguration in class org.springframework.web.servlet.handler.AbstractHandlerMethodMapping<org.springframework.web.servlet.mvc.method.RequestMappingInfo>Copyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.