Class HeaderMethodArgumentResolver
java.lang.Object
org.springframework.messaging.handler.annotation.reactive.AbstractNamedValueMethodArgumentResolver
org.springframework.messaging.handler.annotation.reactive.HeaderMethodArgumentResolver
- All Implemented Interfaces:
HandlerMethodArgumentResolver,SyncHandlerMethodArgumentResolver
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.messaging.handler.annotation.reactive.AbstractNamedValueMethodArgumentResolver
AbstractNamedValueMethodArgumentResolver.NamedValueInfo -
Constructor Summary
ConstructorsConstructorDescriptionHeaderMethodArgumentResolver(org.springframework.core.convert.ConversionService conversionService, @Nullable org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory) -
Method Summary
Modifier and TypeMethodDescriptioncreateNamedValueInfo(org.springframework.core.MethodParameter parameter) Create theAbstractNamedValueMethodArgumentResolver.NamedValueInfoobject for the given method parameter.protected voidhandleMissingValue(String headerName, org.springframework.core.MethodParameter parameter, Message<?> message) Invoked when a value is required, butAbstractNamedValueMethodArgumentResolver.resolveArgumentInternal(org.springframework.core.MethodParameter, org.springframework.messaging.Message<?>, java.lang.String)returnednulland there is no default value.resolveArgumentInternal(org.springframework.core.MethodParameter parameter, Message<?> message, String name) Resolves the given parameter type and value name into an argument value.booleansupportsParameter(org.springframework.core.MethodParameter parameter) Whether the given method parameter is supported by this resolver.Methods inherited from class org.springframework.messaging.handler.annotation.reactive.AbstractNamedValueMethodArgumentResolver
resolveArgumentValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.messaging.handler.invocation.reactive.SyncHandlerMethodArgumentResolver
resolveArgument
-
Constructor Details
-
HeaderMethodArgumentResolver
public HeaderMethodArgumentResolver(org.springframework.core.convert.ConversionService conversionService, @Nullable org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory)
-
-
Method Details
-
supportsParameter
public boolean supportsParameter(org.springframework.core.MethodParameter parameter) Description copied from interface:HandlerMethodArgumentResolverWhether the given method parameter is supported by this resolver.- Parameters:
parameter- the method parameter to check- Returns:
trueif this resolver supports the supplied parameter;falseotherwise
-
createNamedValueInfo
protected AbstractNamedValueMethodArgumentResolver.NamedValueInfo createNamedValueInfo(org.springframework.core.MethodParameter parameter) Description copied from class:AbstractNamedValueMethodArgumentResolverCreate theAbstractNamedValueMethodArgumentResolver.NamedValueInfoobject for the given method parameter. Implementations typically retrieve the method annotation by means ofMethodParameter.getParameterAnnotation(Class).- Specified by:
createNamedValueInfoin classAbstractNamedValueMethodArgumentResolver- Parameters:
parameter- the method parameter- Returns:
- the named value information
-
resolveArgumentInternal
protected @Nullable Object resolveArgumentInternal(org.springframework.core.MethodParameter parameter, Message<?> message, String name) Description copied from class:AbstractNamedValueMethodArgumentResolverResolves the given parameter type and value name into an argument value.- Specified by:
resolveArgumentInternalin classAbstractNamedValueMethodArgumentResolver- Parameters:
parameter- the method parameter to resolve to an argument valuemessage- the current requestname- the name of the value being resolved- Returns:
- the resolved argument. May be
null
-
handleMissingValue
protected void handleMissingValue(String headerName, org.springframework.core.MethodParameter parameter, Message<?> message) Description copied from class:AbstractNamedValueMethodArgumentResolverInvoked when a value is required, butAbstractNamedValueMethodArgumentResolver.resolveArgumentInternal(org.springframework.core.MethodParameter, org.springframework.messaging.Message<?>, java.lang.String)returnednulland there is no default value. Subclasses can throw an appropriate exception for this case.- Specified by:
handleMissingValuein classAbstractNamedValueMethodArgumentResolver- Parameters:
headerName- the name for the valueparameter- the target method parametermessage- the message being processed
-