类 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
- 直接已知子类:
RequestMappingHandlerMapping
public abstract class RequestMappingInfoHandlerMapping extends AbstractHandlerMethodMapping<RequestMappingInfo>
Abstract base class for classes for whichRequestMappingInfo
defines the mapping between a request and a handler method.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev, Sam Brannen
字段概要
从类继承的字段 org.springframework.context.support.ApplicationObjectSupport
logger
从接口继承的字段 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
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
构造器概要
构造器 构造器 说明 RequestMappingInfoHandlerMapping()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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 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.protected void
handleMatch(RequestMappingInfo info, HandlerMethod handlerMethod, ServerWebExchange exchange)
Expose URI template variables, matrix variables, and producible media types in the request.protected HandlerMethod
handleNoMatch(Set<RequestMappingInfo> infos, ServerWebExchange exchange)
Iterate all RequestMappingInfos once again, look if any match by URL at least and raise exceptions accordingly.从类继承的方法 org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping
afterPropertiesSet, createHandlerMethod, detectHandlerMethods, getCorsConfiguration, getHandlerMethods, getMappingForMethod, handlerMethodsInitialized, hasCorsConfigurationSource, initCorsConfiguration, initHandlerMethods, isHandler, lookupHandlerMethod, registerHandlerMethod, registerMapping, unregisterMapping
从类继承的方法 org.springframework.web.reactive.handler.AbstractHandlerMapping
formatMappingName, getCorsProcessor, getHandler, getOrder, getPathPatternParser, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setOrder, setUseCaseSensitiveMatch, setUseTrailingSlashMatch
从类继承的方法 org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext
构造器详细资料
RequestMappingInfoHandlerMapping
public RequestMappingInfoHandlerMapping()
方法详细资料
getMatchingMapping
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.- 指定者:
getMatchingMapping
在类中AbstractHandlerMethodMapping<RequestMappingInfo>
- 参数:
info
- the mapping to get a match forexchange
- the current exchange- 返回:
- an info in case of a match; or
null
otherwise.
getMappingComparator
protected Comparator<RequestMappingInfo> getMappingComparator(ServerWebExchange exchange)
Provide a Comparator to sort RequestMappingInfos matched to a request.- 指定者:
getMappingComparator
在类中AbstractHandlerMethodMapping<RequestMappingInfo>
- 参数:
exchange
- the current exchange- 返回:
- the comparator (never
null
)
getHandlerInternal
public reactor.core.publisher.Mono<HandlerMethod> getHandlerInternal(ServerWebExchange exchange)
从类复制的说明:AbstractHandlerMethodMapping
Look up a handler method for the given request.- 覆盖:
getHandlerInternal
在类中AbstractHandlerMethodMapping<RequestMappingInfo>
- 参数:
exchange
- the current exchange- 返回:
Mono
for the matching handler, if any
handleMatch
protected void handleMatch(RequestMappingInfo info, HandlerMethod handlerMethod, ServerWebExchange exchange)
Expose URI template variables, matrix variables, and producible media types in the request.- 覆盖:
handleMatch
在类中AbstractHandlerMethodMapping<RequestMappingInfo>
- 参数:
info
- the matching mappinghandlerMethod
- the matching methodexchange
- the current exchange- 另请参阅:
HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE
,HandlerMapping.MATRIX_VARIABLES_ATTRIBUTE
,HandlerMapping.PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE
handleNoMatch
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.- 覆盖:
handleNoMatch
在类中AbstractHandlerMethodMapping<RequestMappingInfo>
- 参数:
infos
- all registered mappingsexchange
- the current exchange- 返回:
- an alternative HandlerMethod or
null
- 抛出:
MethodNotAllowedException
- for matches by URL but not by HTTP methodUnsupportedMediaTypeStatusException
- if there are matches by URL and HTTP method but not by consumable media typesNotAcceptableStatusException
- if there are matches by URL and HTTP method but not by producible media typesServerWebInputException
- if there are matches by URL and HTTP method but not by query parameter conditionsException
- provides details that can be translated into an error status code