org.springframework.web.reactive.result.method

## Class RequestMappingInfoHandlerMapping

- java.lang.Object
- - org.springframework.context.support.ApplicationObjectSupport
  - - org.springframework.web.reactive.handler.AbstractHandlerMapping
    - - org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping<RequestMappingInfo>
      - - org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping

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, HandlerMapping

Direct Known Subclasses:
  RequestMappingHandlerMapping

    public abstract class RequestMappingInfoHandlerMapping
    extends AbstractHandlerMethodMapping<RequestMappingInfo>

Abstract base class for classes for which `RequestMappingInfo` defines the mapping between a request and a handler method.

Since:
  5.0
Author:
  Rossen Stoyanchev, Sam Brannen

### Field Summary

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

`logger`

### Fields inherited from interface org.springframework.web.reactive.HandlerMapping

`BEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, 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`

### Constructor Summary

Constructors
Constructor and Description
`RequestMappingInfoHandlerMapping()`

### Method Summary

All Methods Instance Methods Concrete Methods
`reactor.core.publisher.Mono<org.springframework.web.method.HandlerMethod>` `getHandlerInternal(org.springframework.web.server.ServerWebExchange exchange)` Look up a handler method for the given request.
`protected Comparator<RequestMappingInfo>` `getMappingComparator(org.springframework.web.server.ServerWebExchange exchange)` Provide a Comparator to sort RequestMappingInfos matched to a request.
`protected RequestMappingInfo` `getMatchingMapping(RequestMappingInfo info, org.springframework.web.server.ServerWebExchange exchange)` Check if the given RequestMappingInfo matches the current request and return a (potentially new) instance with conditions that match the current request -- for example with a subset of URL patterns.
`protected void` `handleMatch(RequestMappingInfo info, org.springframework.web.method.HandlerMethod handlerMethod, org.springframework.web.server.ServerWebExchange exchange)` Expose URI template variables, matrix variables, and producible media types in the request.
`protected org.springframework.web.method.HandlerMethod` `handleNoMatch(Set<RequestMappingInfo> infos, org.springframework.web.server.ServerWebExchange exchange)` Iterate all RequestMappingInfos once again, look if any match by URL at least and raise exceptions accordingly.

### Methods inherited from class org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping

`afterPropertiesSet, createHandlerMethod, detectHandlerMethods, getCorsConfiguration, getHandlerMethods, getMappingForMethod, handlerMethodsInitialized, hasCorsConfigurationSource, initCorsConfiguration, initHandlerMethods, isHandler, lookupHandlerMethod, registerHandlerMethod, registerMapping, unregisterMapping`

### Methods inherited from class org.springframework.web.reactive.handler.AbstractHandlerMapping

`formatMappingName, getCorsProcessor, getHandler, getOrder, getPathPatternParser, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setOrder, setUseCaseSensitiveMatch, setUseTrailingSlashMatch`

### Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

`getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### RequestMappingInfoHandlerMapping

    public RequestMappingInfoHandlerMapping()

### Method Detail

#### getMatchingMapping

    protected RequestMappingInfo getMatchingMapping(RequestMappingInfo info,
                                                    org.springframework.web.server.ServerWebExchange exchange)

Check if the given RequestMappingInfo matches the current request and return a (potentially new) instance with conditions that match the current request -- for example with a subset of URL patterns.

Specified by:
  `getMatchingMapping` in class `AbstractHandlerMethodMapping<RequestMappingInfo>`
Parameters:
  `info` - the mapping to get a match for
  `exchange` - the current exchange
Returns:
  an info in case of a match; or `null` otherwise.

#### getMappingComparator

    protected Comparator<RequestMappingInfo> getMappingComparator(org.springframework.web.server.ServerWebExchange exchange)

Provide a Comparator to sort RequestMappingInfos matched to a request.

Specified by:
  `getMappingComparator` in class `AbstractHandlerMethodMapping<RequestMappingInfo>`
Parameters:
  `exchange` - the current exchange
Returns:
  the comparator (never `null`)

#### getHandlerInternal

    public reactor.core.publisher.Mono<org.springframework.web.method.HandlerMethod> getHandlerInternal(org.springframework.web.server.ServerWebExchange exchange)

Description copied from class: `AbstractHandlerMethodMapping`
Look up a handler method for the given request.

Overrides:
  `getHandlerInternal` in class `AbstractHandlerMethodMapping<RequestMappingInfo>`
Parameters:
  `exchange` - the current exchange
Returns:
  `Mono` for the matching handler, if any

#### handleMatch

    protected void handleMatch(RequestMappingInfo info,
                               org.springframework.web.method.HandlerMethod handlerMethod,
                               org.springframework.web.server.ServerWebExchange exchange)

Expose URI template variables, matrix variables, and producible media types in the request.

Overrides:
  `handleMatch` in class `AbstractHandlerMethodMapping<RequestMappingInfo>`
Parameters:
  `info` - the matching mapping
  `handlerMethod` - the matching method
  `exchange` - the current exchange
See Also:
  `HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE`, `HandlerMapping.MATRIX_VARIABLES_ATTRIBUTE`, `HandlerMapping.PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE`

#### handleNoMatch

    protected org.springframework.web.method.HandlerMethod handleNoMatch(Set<RequestMappingInfo> infos,
                                                                         org.springframework.web.server.ServerWebExchange exchange)
                                                                  throws Exception

Iterate all RequestMappingInfos once again, look if any match by URL at least and raise exceptions accordingly.

Overrides:
  `handleNoMatch` in class `AbstractHandlerMethodMapping<RequestMappingInfo>`
Parameters:
  `infos` - all registered mappings
  `exchange` - the current exchange
Returns:
  an alternative HandlerMethod or `null`
Throws:
  `org.springframework.web.server.MethodNotAllowedException` - for matches by URL but not by HTTP method
  `org.springframework.web.server.UnsupportedMediaTypeStatusException` - if there are matches by URL and HTTP method but not by consumable media types
  `org.springframework.web.server.NotAcceptableStatusException` - if there are matches by URL and HTTP method but not by producible media types
  `org.springframework.web.server.ServerWebInputException` - if there are matches by URL and HTTP method but not by query parameter conditions
  `Exception` - provides details that can be translated into an error status code