Class DestinationVariableMethodArgumentResolver
java.lang.Object
org.springframework.messaging.handler.annotation.reactive.AbstractNamedValueMethodArgumentResolver
org.springframework.messaging.handler.annotation.reactive.DestinationVariableMethodArgumentResolver
- All Implemented Interfaces:
HandlerMethodArgumentResolver
,SyncHandlerMethodArgumentResolver
public class DestinationVariableMethodArgumentResolver
extends AbstractNamedValueMethodArgumentResolver
Resolve for
@DestinationVariable
method parameters.- Since:
- 5.2
- Author:
- Rossen Stoyanchev
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.messaging.handler.annotation.reactive.AbstractNamedValueMethodArgumentResolver
AbstractNamedValueMethodArgumentResolver.NamedValueInfo
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The name of the header used to for template variables. -
Constructor Summary
ConstructorDescriptionDestinationVariableMethodArgumentResolver
(ConversionService conversionService) -
Method Summary
Modifier and TypeMethodDescriptioncreateNamedValueInfo
(MethodParameter parameter) Create theAbstractNamedValueMethodArgumentResolver.NamedValueInfo
object for the given method parameter.protected void
handleMissingValue
(String name, MethodParameter parameter, Message<?> message) Invoked when a value is required, butAbstractNamedValueMethodArgumentResolver.resolveArgumentInternal(org.springframework.core.MethodParameter, org.springframework.messaging.Message<?>, java.lang.String)
returnednull
and there is no default value.protected Object
resolveArgumentInternal
(MethodParameter parameter, Message<?> message, String name) Resolves the given parameter type and value name into an argument value.boolean
supportsParameter
(MethodParameter parameter) Whether the given method parameter is supported by this resolver.Methods inherited from class org.springframework.messaging.handler.annotation.reactive.AbstractNamedValueMethodArgumentResolver
resolveArgumentValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.messaging.handler.invocation.reactive.SyncHandlerMethodArgumentResolver
resolveArgument
-
Field Details
-
DESTINATION_TEMPLATE_VARIABLES_HEADER
The name of the header used to for template variables.
-
-
Constructor Details
-
DestinationVariableMethodArgumentResolver
-
-
Method Details
-
supportsParameter
Description copied from interface:HandlerMethodArgumentResolver
Whether the given method parameter is supported by this resolver.- Parameters:
parameter
- the method parameter to check- Returns:
true
if this resolver supports the supplied parameter;false
otherwise
-
createNamedValueInfo
protected AbstractNamedValueMethodArgumentResolver.NamedValueInfo createNamedValueInfo(MethodParameter parameter) Description copied from class:AbstractNamedValueMethodArgumentResolver
Create theAbstractNamedValueMethodArgumentResolver.NamedValueInfo
object for the given method parameter. Implementations typically retrieve the method annotation by means ofMethodParameter.getParameterAnnotation(Class)
.- Specified by:
createNamedValueInfo
in classAbstractNamedValueMethodArgumentResolver
- Parameters:
parameter
- the method parameter- Returns:
- the named value information
-
resolveArgumentInternal
@Nullable protected Object resolveArgumentInternal(MethodParameter parameter, Message<?> message, String name) Description copied from class:AbstractNamedValueMethodArgumentResolver
Resolves the given parameter type and value name into an argument value.- Specified by:
resolveArgumentInternal
in 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
Description copied from class:AbstractNamedValueMethodArgumentResolver
Invoked when a value is required, butAbstractNamedValueMethodArgumentResolver.resolveArgumentInternal(org.springframework.core.MethodParameter, org.springframework.messaging.Message<?>, java.lang.String)
returnednull
and there is no default value. Sub-classes can throw an appropriate exception for this case.- Specified by:
handleMissingValue
in classAbstractNamedValueMethodArgumentResolver
- Parameters:
name
- the name for the valueparameter
- the target method parametermessage
- the message being processed
-