HandlerMethod containing the conditions
needed to match the handler method to an incoming request.
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>.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| pack-priv static class | |
| pack-priv class | AbstractHandlerMethodMapping.
A registry that maintains all mappings to handler methods, exposing methods to perform lookups and providing concurrent access. |
| private class | AbstractHandlerMethodMapping.
A thin wrapper around a matched HandlerMethod and its mapping, for the purpose of comparing the best match with a comparator in the context of the current request. |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private static final CorsConfiguration | |
| private boolean | |
| private final AbstractHandlerMethodMapping | |
| private HandlerMethodMappingNamingStrategy | |
| private static final HandlerMethod | |
| private static final String | SCOPED_TARGET_NAME_PREFIX
Bean name prefix for target beans behind scoped proxies. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | addMatchingMappings(Collection<T> mappings, List<AbstractHandlerMethodMapping<T>.
|
| public void | afterPropertiesSet()
Implements org. Detects handler methods at initialization. |
| protected HandlerMethod | Returns: the created HandlerMethodeither a bean name or an actual handler instance handler, Method the target method method)Create the HandlerMethod instance. |
| protected void | detectHandlerMethods(Object
either a bean name or an actual handler instance handler)Look for handler methods in the specified handler bean. |
| private String | |
| protected String[] | |
| protected CorsConfiguration | getCorsConfiguration(Object
the handler to check (never handler, HttpServletRequest null).the current request. request)Overrides org. Retrieve the CORS configuration for the given handler. |
| protected Set | |
| protected HandlerMethod | getHandlerInternal(HttpServletRequest
current HTTP request request)Implements abstract org. Look up a handler method for the given request. |
| public Map | |
| public List | Returns: a list of matching HandlerMethod's ornull; the returned
list will never be modified and is safe to iterate.the mapping name mappingName)Return the handler methods for the given mapping name. |
| protected abstract Comparator | Returns: the comparator (nevernull)the current request request)Return a comparator for sorting matching mappings. |
| protected abstract T | Returns: the mapping, ornull if the method is not mappedthe method to provide a mapping for method, Class<?> the handler type, possibly a subtype of the method's
declaring class handlerType)Provide the mapping for a handler method. |
| protected Set | getMappingPathPatterns(T mapping)
Deprecated
as of 5.3 in favor of providing non-pattern mappings via
getDirectPaths(Object) instead
Extract and return the URL paths contained in the supplied mapping. |
| pack-priv AbstractHandlerMethodMapping | |
| protected abstract T | Returns: the match, ornull if the mapping doesn't matchthe mapping to get a match for mapping, HttpServletRequest the current HTTP servlet request request)Check if a mapping matches the current request and return a (potentially new) mapping with conditions relevant to the current request. |
| public HandlerMethodMappingNamingStrategy | |
| protected void | handleMatch(T
the matching mapping mapping, String mapping lookup path within the current servlet mapping lookupPath, HttpServletRequest the current request request)Invoked when a matching mapping is found. |
| protected HandlerMethod | handleNoMatch(Set<T>
all registered mappings mappings, String mapping lookup path within the current servlet mapping lookupPath, HttpServletRequest the current request request)Invoked when no matching mapping is not found. |
| protected void | handlerMethodsInitialized(Map<T, HandlerMethod>
a read-only map with handler methods and mappings. handlerMethods)Invoked after all handler methods have been detected. |
| protected boolean | hasCorsConfigurationSource(Object handler)
Overrides org. Return |
| protected CorsConfiguration | initCorsConfiguration(Object handler, Method method, T mapping)
Extract and return the CORS configuration for the mapping. |
| protected void | |
| protected abstract boolean | |
| protected HandlerMethod | Returns: the best-matching handler method, ornull if no matchmapping lookup path within the current servlet mapping lookupPath, HttpServletRequest the current request request)Look up the best-matching handler method for the current request. |
| protected void | processCandidateBean(String
the name of the candidate bean beanName)Determine the type of the specified candidate bean and call
|
| protected void | registerHandlerMethod(Object
the bean name of the handler or the handler instance handler, Method the method to register method, T the mapping conditions associated with the handler method mapping)Register a handler method and its unique mapping. |
| public void | registerMapping(T
the mapping for the handler method mapping, Object the handler handler, Method the method method)Register the given mapping. |
| public void | setDetectHandlerMethodsInAncestorContexts(boolean detectHandlerMethodsInAncestorContexts)
Whether to detect handler methods in beans in ancestor ApplicationContexts. |
| public void | setHandlerMethodMappingNamingStrategy(HandlerMethodMappingNamingStrategy<T> namingStrategy)
Configure the naming strategy to use for assigning a default name to every mapped handler method. |
| public void | setPatternParser(PathPatternParser
the parser to use patternParser)Overrides org. Set the |
| public void |