public class HeaderMethodArgumentResolver extends AbstractNamedValueMethodArgumentResolver
@Header
.AbstractNamedValueMethodArgumentResolver.NamedValueInfo
Constructor and Description |
---|
HeaderMethodArgumentResolver(ConversionService cs,
ConfigurableBeanFactory beanFactory) |
Modifier and Type | Method and Description |
---|---|
protected AbstractNamedValueMethodArgumentResolver.NamedValueInfo |
createNamedValueInfo(MethodParameter parameter)
Create the
AbstractNamedValueMethodArgumentResolver.NamedValueInfo object for the given method parameter. |
protected void |
handleMissingValue(String headerName,
MethodParameter parameter,
Message<?> message)
Invoked when a named value is required, but
AbstractNamedValueMethodArgumentResolver.resolveArgumentInternal(MethodParameter, Message, String) returned null 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.
|
handleResolvedValue, resolveArgument
public HeaderMethodArgumentResolver(ConversionService cs, ConfigurableBeanFactory beanFactory)
public boolean supportsParameter(MethodParameter parameter)
HandlerMethodArgumentResolver
parameter
- the method parameter to checktrue
if this resolver supports the supplied parameter;
false
otherwiseprotected AbstractNamedValueMethodArgumentResolver.NamedValueInfo createNamedValueInfo(MethodParameter parameter)
AbstractNamedValueMethodArgumentResolver
AbstractNamedValueMethodArgumentResolver.NamedValueInfo
object for the given method parameter. Implementations typically
retrieve the method annotation by means of MethodParameter.getParameterAnnotation(Class)
.createNamedValueInfo
in class AbstractNamedValueMethodArgumentResolver
parameter
- the method parameterprotected Object resolveArgumentInternal(MethodParameter parameter, Message<?> message, String name) throws Exception
AbstractNamedValueMethodArgumentResolver
resolveArgumentInternal
in class AbstractNamedValueMethodArgumentResolver
parameter
- the method parameter to resolve to an argument valuemessage
- the current requestname
- the name of the value being resolvednull
Exception
- in case of errorsprotected void handleMissingValue(String headerName, MethodParameter parameter, Message<?> message)
AbstractNamedValueMethodArgumentResolver
AbstractNamedValueMethodArgumentResolver.resolveArgumentInternal(MethodParameter, Message, String)
returned null
and
there is no default value. Subclasses typically throw an exception in this case.handleMissingValue
in class AbstractNamedValueMethodArgumentResolver
headerName
- the name for the valueparameter
- the method parametermessage
- the message being processed