Class DestinationVariableMethodArgumentResolver
- java.lang.Object
- org.springframework.messaging.handler.annotation.support.AbstractNamedValueMethodArgumentResolver
- org.springframework.messaging.handler.annotation.support.DestinationVariableMethodArgumentResolver
- All Implemented Interfaces:
HandlerMethodArgumentResolver
public class DestinationVariableMethodArgumentResolver extends AbstractNamedValueMethodArgumentResolver
Resolve for@DestinationVariablemethod parameters.- Since:
- 4.0
- Author:
- Brian Clozel
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.messaging.handler.annotation.support.AbstractNamedValueMethodArgumentResolver
AbstractNamedValueMethodArgumentResolver.NamedValueInfo
Field Summary
Fields Modifier and Type Field Description static StringDESTINATION_TEMPLATE_VARIABLES_HEADERThe name of the header used to for template variables.
Constructor Summary
Constructors Constructor Description DestinationVariableMethodArgumentResolver(ConversionService conversionService)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AbstractNamedValueMethodArgumentResolver.NamedValueInfocreateNamedValueInfo(MethodParameter parameter)Create theAbstractNamedValueMethodArgumentResolver.NamedValueInfoobject for the given method parameter.protected voidhandleMissingValue(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)returnednulland there is no default value.protected ObjectresolveArgumentInternal(MethodParameter parameter, Message<?> message, String name)Resolves the given parameter type and value name into an argument value.booleansupportsParameter(MethodParameter parameter)Whether the given method parameter is supported by this resolver.Methods inherited from class org.springframework.messaging.handler.annotation.support.AbstractNamedValueMethodArgumentResolver
handleResolvedValue, resolveArgument
Field Detail
DESTINATION_TEMPLATE_VARIABLES_HEADER
public static final String DESTINATION_TEMPLATE_VARIABLES_HEADER
The name of the header used to for template variables.
Constructor Detail
DestinationVariableMethodArgumentResolver
public DestinationVariableMethodArgumentResolver(ConversionService conversionService)
Method Detail
supportsParameter
public boolean supportsParameter(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(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
@Nullable protected Object resolveArgumentInternal(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 name, 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. Sub-classes can throw an appropriate exception for this case.- Specified by:
handleMissingValuein classAbstractNamedValueMethodArgumentResolver- Parameters:
name- the name for the valueparameter- the target method parametermessage- the message being processed