Class AbstractWebMvcEndpointHandlerMapping

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.core.Ordered, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.handler.MatchableHandlerMapping, org.springframework.web.servlet.HandlerMapping
    Direct Known Subclasses:
    WebMvcEndpointHandlerMapping

    public abstract class AbstractWebMvcEndpointHandlerMapping
    extends org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping
    implements org.springframework.beans.factory.InitializingBean, org.springframework.web.servlet.handler.MatchableHandlerMapping
    A custom HandlerMapping that makes web endpoints available over HTTP using Spring MVC.
    Since:
    2.0.0
    • Field Summary

      • Fields inherited from class org.springframework.context.support.ApplicationObjectSupport

        logger
      • Fields inherited from interface org.springframework.web.servlet.HandlerMapping

        BEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, INTROSPECT_TYPE_LEVEL_MAPPING, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE
      • Fields inherited from interface org.springframework.core.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and TypeMethodDescription
      protected org.springframework.web.method.HandlerMethodcreateHandlerMethod​(Object handler, Method method) 
      protected voidextendInterceptors​(List<Object> interceptors) 
      Collection<ExposableWebEndpoint>getEndpoints()
      Return the web endpoints being mapped.
      protected abstract AbstractWebMvcEndpointHandlerMapping.LinksHandlergetLinksHandler()
      Return the Handler providing actuator links at the root endpoint.
      protected org.springframework.web.servlet.mvc.method.RequestMappingInfogetMappingForMethod​(Method method, Class<?> handlerType) 
      protected org.springframework.web.cors.CorsConfigurationinitCorsConfiguration​(Object handler, Method method, org.springframework.web.servlet.mvc.method.RequestMappingInfo mapping) 
      protected voidinitHandlerMethods() 
      protected booleanisHandler​(Class<?> beanType) 
      org.springframework.web.servlet.handler.RequestMatchResultmatch​(javax.servlet.http.HttpServletRequest request, String pattern) 
      protected AbstractWebMvcEndpointHandlerMapping.ServletWebOperationwrapServletWebOperation​(ExposableWebEndpoint endpoint, WebOperation operation, AbstractWebMvcEndpointHandlerMapping.ServletWebOperation servletWebOperation)
      Hook point that allows subclasses to wrap the AbstractWebMvcEndpointHandlerMapping.ServletWebOperation before it's called.
      • Methods inherited from class org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping

        getMappingComparator, getMappingPathPatterns, getMatchingMapping, handleMatch, handleNoMatch
      • Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMethodMapping

        afterPropertiesSet, detectHandlerMethods, getCandidateBeanNames, getCorsConfiguration, getHandlerInternal, getHandlerMethods, getHandlerMethodsForMappingName, getNamingStrategy, handlerMethodsInitialized, lookupHandlerMethod, processCandidateBean, registerHandlerMethod, registerMapping, setDetectHandlerMethodsInAncestorContexts, setHandlerMethodMappingNamingStrategy, unregisterMapping
      • Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping

        adaptInterceptor, detectMappedInterceptors, formatMappingName, getAdaptedInterceptors, getCorsConfigurations, getCorsHandlerExecutionChain, getCorsProcessor, getDefaultHandler, getHandler, getHandlerExecutionChain, getMappedInterceptors, getOrder, getPathMatcher, getUrlPathHelper, initApplicationContext, initInterceptors, setAlwaysUseFullPath, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelper
      • Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport

        getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
      • Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

        getApplicationContext, getMessageSourceAccessor, obtainApplicationContext, requiredContextClass, setApplicationContext
      • Methods inherited from interface org.springframework.web.servlet.HandlerMapping

        getHandler
      • Methods inherited from interface org.springframework.beans.factory.InitializingBean

        afterPropertiesSet
    • Constructor Detail

      • AbstractWebMvcEndpointHandlerMapping

        public AbstractWebMvcEndpointHandlerMapping​(EndpointMapping endpointMapping,
                                                    Collection<ExposableWebEndpoint> endpoints,
                                                    EndpointMediaTypes endpointMediaTypes,
                                                    org.springframework.web.cors.CorsConfiguration corsConfiguration)
        Creates a new AbstractWebMvcEndpointHandlerMapping that provides mappings for the operations of the given endpoints.
        Parameters:
        endpointMapping - the base mapping for all endpoints
        endpoints - the web endpoints
        endpointMediaTypes - media types consumed and produced by the endpoints
        corsConfiguration - the CORS configuration for the endpoints or null
    • Method Detail

      • initHandlerMethods

        protected void initHandlerMethods()
        Overrides:
        initHandlerMethods in class org.springframework.web.servlet.handler.AbstractHandlerMethodMapping<org.springframework.web.servlet.mvc.method.RequestMappingInfo>
      • createHandlerMethod

        protected org.springframework.web.method.HandlerMethod createHandlerMethod​(Object handler,
                                                                                   Method method)
        Overrides:
        createHandlerMethod in class org.springframework.web.servlet.handler.AbstractHandlerMethodMapping<org.springframework.web.servlet.mvc.method.RequestMappingInfo>
      • match

        public org.springframework.web.servlet.handler.RequestMatchResult match​(javax.servlet.http.HttpServletRequest request,
                                                                                String pattern)
        Specified by:
        match in interface org.springframework.web.servlet.handler.MatchableHandlerMapping
      • initCorsConfiguration

        protected org.springframework.web.cors.CorsConfiguration initCorsConfiguration​(Object handler,
                                                                                       Method method,
                                                                                       org.springframework.web.servlet.mvc.method.RequestMappingInfo mapping)
        Overrides:
        initCorsConfiguration in class org.springframework.web.servlet.handler.AbstractHandlerMethodMapping<org.springframework.web.servlet.mvc.method.RequestMappingInfo>
      • isHandler

        protected boolean isHandler​(Class<?> beanType)
        Specified by:
        isHandler in class org.springframework.web.servlet.handler.AbstractHandlerMethodMapping<org.springframework.web.servlet.mvc.method.RequestMappingInfo>
      • getMappingForMethod

        protected org.springframework.web.servlet.mvc.method.RequestMappingInfo getMappingForMethod​(Method method,
                                                                                                    Class<?> handlerType)
        Specified by:
        getMappingForMethod in class org.springframework.web.servlet.handler.AbstractHandlerMethodMapping<org.springframework.web.servlet.mvc.method.RequestMappingInfo>
      • extendInterceptors

        protected void extendInterceptors​(List<Object> interceptors)
        Overrides:
        extendInterceptors in class org.springframework.web.servlet.handler.AbstractHandlerMapping