@FunctionalInterface interface WebArgumentResolver
SPI for resolving custom arguments for a specific handler method parameter. Typically implemented to detect special parameter types, resolving well-known argument values for them.
A typical implementation could look like as follows:
public class MySpecialArgumentResolver implements WebArgumentResolver { public Object resolveArgument(MethodParameter methodParameter, NativeWebRequest webRequest) { if (methodParameter.getParameterType().equals(MySpecialArg.class)) { return new MySpecialArg("myValue"); } return UNRESOLVED; } }
Author
Juergen Hoeller
Since
2.5.2
static val UNRESOLVED: Any
Marker to be returned when the resolver does not know how to handle the given method parameter. |
abstract fun resolveArgument(methodParameter: MethodParameter, webRequest: NativeWebRequest): Any
Resolve an argument for the given handler method parameter within the given web request. |