Class AbstractNamedValueArgumentResolver
java.lang.Object
org.springframework.web.service.invoker.AbstractNamedValueArgumentResolver
- All Implemented Interfaces:
HttpServiceArgumentResolver
- Direct Known Subclasses:
CookieValueArgumentResolver
,PathVariableArgumentResolver
,RequestHeaderArgumentResolver
,RequestParamArgumentResolver
public abstract class AbstractNamedValueArgumentResolver
extends Object
implements HttpServiceArgumentResolver
Base class for arguments that resolve to a named request value such as a
request header, path variable, cookie, and others.
- Since:
- 6.0
- Author:
- Rossen Stoyanchev
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Info about a request value, typically extracted from a method parameter annotation. -
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractNamedValueArgumentResolver
(ConversionService conversionService) Create an instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
addRequestValue
(String name, String value, HttpRequestValues.Builder requestValues) Add the given, single request value.protected abstract AbstractNamedValueArgumentResolver.NamedValueInfo
createNamedValueInfo
(MethodParameter parameter) Return information about the request value, ornull
if the parameter does not represent a request value of interest.Return the configuredConversionService
.boolean
resolve
(Object argument, MethodParameter parameter, HttpRequestValues.Builder requestValues) Resolve the argument value.
-
Field Details
-
logger
-
-
Constructor Details
-
AbstractNamedValueArgumentResolver
Create an instance.- Parameters:
conversionService
- theConversionService
to use to format Object to String values
-
-
Method Details
-
getConversionService
Return the configuredConversionService
. -
resolve
public boolean resolve(@Nullable Object argument, MethodParameter parameter, HttpRequestValues.Builder requestValues) Description copied from interface:HttpServiceArgumentResolver
Resolve the argument value.- Specified by:
resolve
in interfaceHttpServiceArgumentResolver
- Parameters:
argument
- the argument valueparameter
- the method parameter for the argumentrequestValues
- builder to add HTTP request values to- Returns:
true
if the argument was resolved,false
otherwise
-
createNamedValueInfo
@Nullable protected abstract AbstractNamedValueArgumentResolver.NamedValueInfo createNamedValueInfo(MethodParameter parameter) Return information about the request value, ornull
if the parameter does not represent a request value of interest. -
addRequestValue
protected abstract void addRequestValue(String name, String value, HttpRequestValues.Builder requestValues) Add the given, single request value. This may be called multiples times if the request value is multivalued.- Parameters:
name
- the request value namevalue
- the valuerequestValues
- builder to add the request value to
-