Class AbstractHandlerMethodMapping<T>
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.reactive.handler.AbstractHandlerMapping
org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping<T>
- Type Parameters:
T- the mapping for aHandlerMethodcontaining the conditions needed to match the handler method to an incoming request.
- All Implemented Interfaces:
Aware, BeanNameAware, InitializingBean, ApplicationContextAware, Ordered, HandlerMapping
- Direct Known Subclasses:
RequestMappingInfoHandlerMapping
public abstract class AbstractHandlerMethodMapping<T>
extends AbstractHandlerMapping
implements InitializingBean
Abstract base class for
HandlerMapping implementations that define
a mapping between a request and a HandlerMethod.
For each registered handler method, a unique mapping is maintained with
subclasses defining the details of the mapping type <T>.
- Since:
- 5.0
- Author:
- Rossen Stoyanchev, Brian Clozel, Sam Brannen
-
Field Summary
Fields inherited from class AbstractHandlerMapping
mappingsLoggerFields inherited from class ApplicationObjectSupport
loggerFields inherited from interface HandlerMapping
API_VERSION_ATTRIBUTE, BEST_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 Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDetects handler methods at initialization.protected HandlerMethodcreateHandlerMethod(Object handler, Method method) Create the HandlerMethod instance.protected voiddetectHandlerMethods(Object handler) Look for handler methods in a handler.protected @Nullable CorsConfigurationgetCorsConfiguration(Object handler, ServerWebExchange exchange) Retrieve the CORS configuration for the given handler.getDirectPaths(T mapping) Return 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.Return a (read-only) map with all mappings and HandlerMethod's.protected abstract Comparator<T> getMappingComparator(ServerWebExchange exchange) Return a comparator for sorting matching mappings.getMappingForMethod(Method method, Class<?> handlerType) Provide the mapping for a handler method.getMatchingMapping(T mapping, ServerWebExchange exchange) Check if a mapping matches the current request and return a (potentially new) mapping with conditions relevant to the current request.protected voidhandleMatch(T mapping, HandlerMethod handlerMethod, ServerWebExchange exchange) Invoked when a matching mapping is found.protected @Nullable HandlerMethodhandleNoMatch(Set<T> mappings, ServerWebExchange exchange) Invoked when no matching mapping is not found.protected voidhandlerMethodsInitialized(Map<T, HandlerMethod> handlerMethods) Invoked after all handler methods have been detected.protected booleanhasCorsConfigurationSource(Object handler) Returntrueif there is aCorsConfigurationSourcefor this handler.protected @Nullable CorsConfigurationinitCorsConfiguration(Object handler, Method method, T mapping) Extract and return the CORS configuration for the mapping.protected voidScan beans in the ApplicationContext, detect and register handler methods.protected abstract boolean