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:
- Aware,- BeanNameAware,- InitializingBean,- ApplicationContextAware,- 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 SummaryFields inherited from class org.springframework.web.reactive.handler.AbstractHandlerMappingmappingsLoggerFields inherited from class org.springframework.context.support.ApplicationObjectSupportloggerFields inherited from interface org.springframework.web.reactive.HandlerMappingBEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTEFields inherited from interface org.springframework.core.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturn the request mapping paths that are not patterns.reactor.core.publisher.Mono<HandlerMethod>getHandlerInternal(ServerWebExchange exchange) Look up a handler method for the given request.protected Comparator<RequestMappingInfo>getMappingComparator(ServerWebExchange exchange) Provide a Comparator to sort RequestMappingInfos matched to a request.protected RequestMappingInfogetMatchingMapping(RequestMappingInfo info, 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 voidhandleMatch(RequestMappingInfo info, HandlerMethod handlerMethod, ServerWebExchange exchange) Expose URI template variables, matrix variables, and producible media types in the request.protected HandlerMethodhandleNoMatch(Set<RequestMappingInfo> infos, 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.AbstractHandlerMethodMappingafterPropertiesSet, createHandlerMethod, detectHandlerMethods, getCorsConfiguration, getHandlerMethods, getMappingForMethod, handlerMethodsInitialized, hasCorsConfigurationSource, initCorsConfiguration, initHandlerMethods, isHandler, lookupHandlerMethod, registerHandlerMethod, registerMapping, unregisterMappingMethods inherited from class org.springframework.web.reactive.handler.AbstractHandlerMappingformatMappingName, getCorsProcessor, getHandler, getOrder, getPathPatternParser, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setOrder, setUseCaseSensitiveMatch, setUseTrailingSlashMatchMethods inherited from class org.springframework.context.support.ApplicationObjectSupportgetApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext
- 
Constructor Details- 
RequestMappingInfoHandlerMappingpublic RequestMappingInfoHandlerMapping()
 
- 
- 
Method Details- 
getDirectPathsDescription copied from class:AbstractHandlerMethodMappingReturn the request mapping paths that are not patterns.- Overrides:
- getDirectPathsin class- AbstractHandlerMethodMapping<RequestMappingInfo>
 
- 
getMatchingMapping@Nullable protected RequestMappingInfo getMatchingMapping(RequestMappingInfo info, 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:
- getMatchingMappingin 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 nullotherwise.
 
- 
getMappingComparatorProvide a Comparator to sort RequestMappingInfos matched to a request.- Specified by:
- getMappingComparatorin class- AbstractHandlerMethodMapping<RequestMappingInfo>
- Parameters:
- exchange- the current exchange
- Returns:
- the comparator (never null)
 
- 
getHandlerInternalDescription copied from class:AbstractHandlerMethodMappingLook up a handler method for the given request.- Overrides:
- getHandlerInternalin class- AbstractHandlerMethodMapping<RequestMappingInfo>
- Parameters:
- exchange- the current exchange
- Returns:
- Monofor the matching handler, if any
 
- 
handleMatchprotected void handleMatch(RequestMappingInfo info, HandlerMethod handlerMethod, ServerWebExchange exchange) Expose URI template variables, matrix variables, and producible media types in the request.- Overrides:
- handleMatchin class- AbstractHandlerMethodMapping<RequestMappingInfo>
- Parameters:
- info- the matching mapping
- handlerMethod- the matching method
- exchange- the current exchange
- See Also:
 
- 
handleNoMatch@Nullable protected HandlerMethod handleNoMatch(Set<RequestMappingInfo> infos, ServerWebExchange exchange) throws Exception Iterate all RequestMappingInfos once again, look if any match by URL at least and raise exceptions accordingly.- Overrides:
- handleNoMatchin class- AbstractHandlerMethodMapping<RequestMappingInfo>
- Parameters:
- infos- all registered mappings
- exchange- the current exchange
- Returns:
- an alternative HandlerMethod or null
- Throws:
- MethodNotAllowedException- for matches by URL but not by HTTP method
- UnsupportedMediaTypeStatusException- if there are matches by URL and HTTP method but not by consumable media types
- NotAcceptableStatusException- if there are matches by URL and HTTP method but not by producible media types
- 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
 
 
-