class ControllerMethodResolver
extends java.lang.Object
RequestMappingHandlerAdapter
with
resolving, initializing, and caching annotated methods declared in
@Controller
and @ControllerAdvice
components:
@InitBinder
@ModelAttribute
@RequestMapping
@ExceptionHandler
Modifier and Type | Class and Description |
---|---|
private static class |
ControllerMethodResolver.ArgumentResolverRegistrar |
Constructor and Description |
---|
ControllerMethodResolver(ArgumentResolverConfigurer argumentResolvers,
java.util.List<HttpMessageReader<?>> messageReaders,
ReactiveAdapterRegistry reactiveRegistry,
ConfigurableApplicationContext context) |
Modifier and Type | Method and Description |
---|---|
private void |
addResolversTo(ControllerMethodResolver.ArgumentResolverRegistrar registrar,
ReactiveAdapterRegistry reactiveRegistry,
ConfigurableApplicationContext context) |
private InvocableHandlerMethod |
createAttributeMethod(java.lang.Object bean,
java.lang.reflect.Method method) |
InvocableHandlerMethod |
getExceptionHandlerMethod(java.lang.Throwable ex,
HandlerMethod handlerMethod)
Find an
@ExceptionHandler method in @ControllerAdvice
components or in the controller of the given @RequestMapping method. |
private SyncInvocableHandlerMethod |
getInitBinderMethod(java.lang.Object bean,
java.lang.reflect.Method method) |
java.util.List<SyncInvocableHandlerMethod> |
getInitBinderMethods(HandlerMethod handlerMethod)
Find
@InitBinder methods in @ControllerAdvice components
or in the controller of the given @RequestMapping method. |
java.util.List<InvocableHandlerMethod> |
getModelAttributeMethods(HandlerMethod handlerMethod)
Find
@ModelAttribute methods in @ControllerAdvice
components or in the controller of the given @RequestMapping method. |
InvocableHandlerMethod |
getRequestMappingMethod(HandlerMethod handlerMethod)
Return an
InvocableHandlerMethod for the given
@RequestMapping method initialized with argument resolvers. |
SessionAttributesHandler |
getSessionAttributesHandler(HandlerMethod handlerMethod)
Return the handler for the type-level
@SessionAttributes annotation
based on the given controller method. |
private void |
initControllerAdviceCaches(ApplicationContext applicationContext) |
private static Log logger
private final java.util.List<SyncHandlerMethodArgumentResolver> initBinderResolvers
private final java.util.List<HandlerMethodArgumentResolver> modelAttributeResolvers
private final java.util.List<HandlerMethodArgumentResolver> requestMappingResolvers
private final java.util.List<HandlerMethodArgumentResolver> exceptionHandlerResolvers
private final ReactiveAdapterRegistry reactiveAdapterRegistry
private final java.util.Map<java.lang.Class<?>,java.util.Set<java.lang.reflect.Method>> initBinderMethodCache
private final java.util.Map<java.lang.Class<?>,java.util.Set<java.lang.reflect.Method>> modelAttributeMethodCache
private final java.util.Map<java.lang.Class<?>,ExceptionHandlerMethodResolver> exceptionHandlerCache
private final java.util.Map<ControllerAdviceBean,java.util.Set<java.lang.reflect.Method>> initBinderAdviceCache
private final java.util.Map<ControllerAdviceBean,java.util.Set<java.lang.reflect.Method>> modelAttributeAdviceCache
private final java.util.Map<ControllerAdviceBean,ExceptionHandlerMethodResolver> exceptionHandlerAdviceCache
private final java.util.Map<java.lang.Class<?>,SessionAttributesHandler> sessionAttributesHandlerCache
private static final ReflectionUtils.MethodFilter BINDER_METHODS
@InitBinder
methods.private static final ReflectionUtils.MethodFilter ATTRIBUTE_METHODS
@ModelAttribute
methods.ControllerMethodResolver(ArgumentResolverConfigurer argumentResolvers, java.util.List<HttpMessageReader<?>> messageReaders, ReactiveAdapterRegistry reactiveRegistry, ConfigurableApplicationContext context)
private void addResolversTo(ControllerMethodResolver.ArgumentResolverRegistrar registrar, ReactiveAdapterRegistry reactiveRegistry, ConfigurableApplicationContext context)
private void initControllerAdviceCaches(@Nullable ApplicationContext applicationContext)
public InvocableHandlerMethod getRequestMappingMethod(HandlerMethod handlerMethod)
InvocableHandlerMethod
for the given
@RequestMapping
method initialized with argument resolvers.public java.util.List<SyncInvocableHandlerMethod> getInitBinderMethods(HandlerMethod handlerMethod)
@InitBinder
methods in @ControllerAdvice
components
or in the controller of the given @RequestMapping
method.private SyncInvocableHandlerMethod getInitBinderMethod(java.lang.Object bean, java.lang.reflect.Method method)
public java.util.List<InvocableHandlerMethod> getModelAttributeMethods(HandlerMethod handlerMethod)
@ModelAttribute
methods in @ControllerAdvice
components or in the controller of the given @RequestMapping
method.private InvocableHandlerMethod createAttributeMethod(java.lang.Object bean, java.lang.reflect.Method method)
@Nullable public InvocableHandlerMethod getExceptionHandlerMethod(java.lang.Throwable ex, HandlerMethod handlerMethod)
@ExceptionHandler
method in @ControllerAdvice
components or in the controller of the given @RequestMapping
method.public SessionAttributesHandler getSessionAttributesHandler(HandlerMethod handlerMethod)
@SessionAttributes
annotation
based on the given controller method.