Top Description Fields Constructors Methods
org.springframework.web.reactive.result.method.annotation

pack-priv Class ControllerMethodResolver

extends Object
Class Inheritance
Imports
java.lang.reflect.Method, java.util.ArrayList, .Collections, .LinkedHashMap, .List, .Map, .Set, java.util.concurrent.ConcurrentHashMap, java.util.function.Predicate, org.apache.commons.logging.Log, .LogFactory, org.springframework.beans.factory.config.ConfigurableListableBeanFactory, org.springframework.context.ApplicationContext, .ConfigurableApplicationContext, org.springframework.core.KotlinDetector, .MethodIntrospector, .MethodParameter, .ReactiveAdapterRegistry, org.springframework.core.annotation.AnnotatedElementUtils, org.springframework.http.codec.HttpMessageReader, org.springframework.lang.Nullable, org.springframework.util.Assert, .ClassUtils, .ReflectionUtils.MethodFilter, org.springframework.validation.method.MethodValidator, org.springframework.web.bind.annotation.InitBinder, .ModelAttribute, .RequestMapping, org.springframework.web.bind.support.WebBindingInitializer, org.springframework.web.method.ControllerAdviceBean, .HandlerMethod, org.springframework.web.method.annotation.ExceptionHandlerMethodResolver, .HandlerMethodValidator, org.springframework.web.reactive.result.method.HandlerMethodArgumentResolver, .InvocableHandlerMethod, .SyncHandlerMethodArgumentResolver, .SyncInvocableHandlerMethod

Package-private class to assist RequestMappingHandlerAdapter with resolving, initializing, and caching annotated methods declared in @Controller and @ControllerAdvice components.

Assists with the following annotations:

Author
Rossen Stoyanchev
Since
5.0

Field Summary

Modifier and TypeField and Description
private static final boolean
private final Map<ControllerAdviceBean, ExceptionHandlerMethodResolver>
private final Map<Class<?>, ExceptionHandlerMethodResolver>
private final List<HandlerMethodArgumentResolver>
private static final ReflectionUtils.MethodFilter
INIT_BINDER_METHODS

MethodFilter that matches @InitBinder methods.

private final Map<ControllerAdviceBean, Set<Method>>
private final Map<Class<?>, Set<Method>>
private final List<SyncHandlerMethodArgumentResolver>
private static final Log
private final MethodValidator
private static final ReflectionUtils.MethodFilter
MODEL_ATTRIBUTE_METHODS

MethodFilter that matches @ModelAttribute methods.

private final Map<ControllerAdviceBean, Set<Method>>
private final Map<Class<?>, Set<Method>>
private final List<HandlerMethodArgumentResolver>
private final ReactiveAdapterRegistry
private final List<HandlerMethodArgumentResolver>
private final Map<Class<?>, SessionAttributesHandler>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private InvocableHandlerMethod
private static List<HandlerMethodArgumentResolver>
public InvocableHandlerMethod
getExceptionHandlerMethod(Throwable
the exception to find a handler for
ex
,
HandlerMethod
the controller method that raised the exception, or if null, check only @ControllerAdvice classes.
handlerMethod
)

Look for an @ExceptionHandler method within the class of the given controller method, and also within @ControllerAdvice classes that are applicable to the class of the given controller method.

private SyncInvocableHandlerMethod
public List<SyncInvocableHandlerMethod>
getInitBinderMethods(HandlerMethod handlerMethod)

Find @InitBinder methods in @ControllerAdvice components or in the controller of the given @RequestMapping method.

public List<InvocableHandlerMethod>
getModelAttributeMethods(HandlerMethod handlerMethod)

Find @ModelAttribute methods in @ControllerAdvice components or in the controller of the given @RequestMapping method.

public InvocableHandlerMethod
getRequestMappingMethod(HandlerMethod handlerMethod)

Return an InvocableHandlerMethod for the given @RequestMapping method initialized with argument resolvers.

public SessionAttributesHandler
getSessionAttributesHandler(HandlerMethod handlerMethod)

Return the handler for the type-level @SessionAttributes annotation based on the given controller method.

public boolean
private List<SyncHandlerMethodArgumentResolver>
private void
private static List<HandlerMethodArgumentResolver>
initResolvers(ArgumentResolverConfigurer customResolvers, ReactiveAdapterRegistry adapterRegistry, ConfigurableApplicationContext context, boolean supportDataBinding, List<HttpMessageReader<?>> readers)

private static Predicate<MethodParameter>
private static List<HandlerMethodArgumentResolver>
private static List<HandlerMethodArgumentResolver>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BEAN_VALIDATION_PRESENTback to summary
private static final boolean BEAN_VALIDATION_PRESENT
exceptionHandlerAdviceCacheback to summary
private final Map<ControllerAdviceBean, ExceptionHandlerMethodResolver> exceptionHandlerAdviceCache
exceptionHandlerCacheback to summary
private final Map<Class<?>, ExceptionHandlerMethodResolver> exceptionHandlerCache
exceptionHandlerResolversback to summary
private final List<HandlerMethodArgumentResolver> exceptionHandlerResolvers
INIT_BINDER_METHODSback to summary
private static final ReflectionUtils.MethodFilter INIT_BINDER_METHODS

MethodFilter that matches @InitBinder methods.

initBinderAdviceCacheback to summary
private final Map<ControllerAdviceBean, Set<Method>> initBinderAdviceCache
initBinderMethodCacheback to summary
private final Map<Class<?>, Set<Method>> initBinderMethodCache
initBinderResolversback to summary
private final List<SyncHandlerMethodArgumentResolver> initBinderResolvers
loggerback to summary
private static final Log logger
methodValidatorback to summary
private final MethodValidator methodValidator
Annotations
@Nullable
MODEL_ATTRIBUTE_METHODSback to summary
private static final ReflectionUtils.MethodFilter MODEL_ATTRIBUTE_METHODS

MethodFilter that matches @ModelAttribute methods.

modelAttributeAdviceCacheback to summary
private final Map<ControllerAdviceBean, Set<Method>> modelAttributeAdviceCache
modelAttributeMethodCacheback to summary
private final Map<Class<?>, Set<Method>> modelAttributeMethodCache
modelAttributeResolversback to summary
private final List<HandlerMethodArgumentResolver> modelAttributeResolvers
reactiveAdapterRegistryback to summary
private final ReactiveAdapterRegistry reactiveAdapterRegistry
requestMappingResolversback to summary
private final List<HandlerMethodArgumentResolver> requestMappingResolvers
sessionAttributesHandlerCacheback to summary
private final Map<Class<?>, SessionAttributesHandler> sessionAttributesHandlerCache

Constructor Detail

ControllerMethodResolverback to summary
pack-priv ControllerMethodResolver(ArgumentResolverConfigurer customResolvers, ReactiveAdapterRegistry adapterRegistry, ConfigurableApplicationContext context, List<HttpMessageReader<?>> readers, WebBindingInitializer webBindingInitializer)

Method Detail

createAttributeMethodback to summary
private InvocableHandlerMethod createAttributeMethod(Object bean, Method method)
exceptionHandlerResolversback to summary
private static List<HandlerMethodArgumentResolver> exceptionHandlerResolvers(ArgumentResolverConfigurer customResolvers, ReactiveAdapterRegistry adapterRegistry, ConfigurableApplicationContext context)
getExceptionHandlerMethodback to summary
public InvocableHandlerMethod getExceptionHandlerMethod(Throwable ex, HandlerMethod handlerMethod)

Look for an @ExceptionHandler method within the class of the given controller method, and also within @ControllerAdvice classes that are applicable to the class of the given controller method.

Parameters
ex:Throwable

the exception to find a handler for

handlerMethod:HandlerMethod

the controller method that raised the exception, or if null, check only @ControllerAdvice classes.

Annotations
@Nullable
getInitBinderMethodback to summary
private SyncInvocableHandlerMethod getInitBinderMethod(Object bean, Method method)
getInitBinderMethodsback to summary
public List<SyncInvocableHandlerMethod> getInitBinderMethods(HandlerMethod handlerMethod)

Find @InitBinder methods in @ControllerAdvice components or in the controller of the given @RequestMapping method.

getModelAttributeMethodsback to summary
public List<InvocableHandlerMethod> getModelAttributeMethods(HandlerMethod handlerMethod)

Find @ModelAttribute methods in @ControllerAdvice components or in the controller of the given @RequestMapping method.

getRequestMappingMethodback to summary
public InvocableHandlerMethod getRequestMappingMethod(HandlerMethod handlerMethod)

Return an InvocableHandlerMethod for the given @RequestMapping method initialized with argument resolvers.

getSessionAttributesHandlerback to summary
public SessionAttributesHandler getSessionAttributesHandler(HandlerMethod handlerMethod)

Return the handler for the type-level @SessionAttributes annotation based on the given controller method.

hasMethodValidatorback to summary
public boolean hasMethodValidator()
initBinderResolversback to summary
private List<SyncHandlerMethodArgumentResolver> initBinderResolvers(ArgumentResolverConfigurer customResolvers, ReactiveAdapterRegistry adapterRegistry, ConfigurableApplicationContext context)
initControllerAdviceCachesback to summary
private void initControllerAdviceCaches(ApplicationContext applicationContext)
initResolversback to summary
private static List<HandlerMethodArgumentResolver> initResolvers(ArgumentResolverConfigurer customResolvers, ReactiveAdapterRegistry adapterRegistry, ConfigurableApplicationContext context, boolean supportDataBinding, List<HttpMessageReader<?>> readers)
methodParamPredicateback to summary
private static Predicate<MethodParameter> methodParamPredicate(List<HandlerMethodArgumentResolver> resolvers, Class<?> resolverType)
modelMethodResolversback to summary
private static List<HandlerMethodArgumentResolver> modelMethodResolvers(ArgumentResolverConfigurer customResolvers, ReactiveAdapterRegistry adapterRegistry, ConfigurableApplicationContext context)
requestMappingResolversback to summary
private static List<HandlerMethodArgumentResolver> requestMappingResolvers(ArgumentResolverConfigurer customResolvers, ReactiveAdapterRegistry adapterRegistry, ConfigurableApplicationContext context, List<HttpMessageReader<?>> readers)