PathVariable.
An @PathVariable is a named value that gets resolved from a URI template variable.
It is always required and does not have a default value to fall back on. See the base class
org.
for more information on how named values are processed.
If the method parameter type is Map, the name specified in the annotation is used
to resolve the URI variable String value. The value is then converted to a Map via
type conversion, assuming a suitable Converter or PropertyEditor has been
registered.
A WebDataBinder is invoked to apply type conversion to resolved path variable
values that don't yet match the method parameter type.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final TypeDescriptor |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | contributeMethodArgument(MethodParameter
the controller method parameter (never parameter, Object null)the argument value (possibly value, UriComponentsBuilder null)the builder to update (never builder, Map<String, Object> null)a map to add URI variables to (never uriVariables, ConversionService null)a ConversionService to format values as Strings conversionService)Implements org. Process the given method argument and either update the
|
| protected AbstractNamedValueMethodArgumentResolver. | createNamedValueInfo(MethodParameter
the method parameter parameter)Implements abstract org. Create the |
| protected String | |
| protected void | handleMissingValue(String
the name for the value name, MethodParameter the method parameter parameter)
Invoked when a named value is required, but |
| protected void | handleMissingValueAfterConversion(String
the name for the value name, MethodParameter the method parameter parameter, NativeWebRequest the current request request)
Invoked when a named value is present but becomes |
| protected void | handleResolvedValue(Object
the resolved argument value arg, String the argument name name, MethodParameter the argument parameter type parameter, ModelAndViewContainer the mavContainer, NativeWebRequest ModelAndViewContainer (may be null)the current request request)
Invoked after a value is resolved. |
| protected Object | resolveName(String
the name of the value being resolved name, MethodParameter the method parameter to resolve to an argument value
(pre-nested in case of a parameter, NativeWebRequest java. declaration)the current request request)Implements abstract org. Resolve the given parameter type and value name into an argument value. |
| public boolean | supportsParameter(MethodParameter
the method parameter to check parameter)Implements org. Whether this contributor supports the given method parameter. |
| STRING_TYPE_DESCRIPTOR | back to summary |
|---|---|
| private static final TypeDescriptor STRING_TYPE_DESCRIPTOR | |
| PathVariableMethodArgumentResolver | back to summary |
|---|---|
| public PathVariableMethodArgumentResolver() | |
| contributeMethodArgument | back to summary |
|---|---|
| public void contributeMethodArgument(MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String, Object> uriVariables, ConversionService conversionService) Implements org. Doc from org. Process the given method argument and either update the
| |
| createNamedValueInfo | back to summary |
|---|---|
| protected AbstractNamedValueMethodArgumentResolver. Implements abstract org. Create the
| |
| formatUriValue | back to summary |
|---|---|
protected String formatUriValue(ConversionService cs, TypeDescriptor sourceType, Object value)
| |
| handleMissingValue | back to summary |
|---|---|
| protected void handleMissingValue(String name, MethodParameter parameter) throws ServletRequestBindingException Invoked when a named value is required, but
| |
| handleMissingValueAfterConversion | back to summary |
|---|---|
| protected void handleMissingValueAfterConversion(String name, MethodParameter parameter, NativeWebRequest request) throws Exception Invoked when a named value is present but becomes
| |
| handleResolvedValue | back to summary |
|---|---|
| protected void handleResolvedValue(Object arg, String name, MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest request) Invoked after a value is resolved.
| |
| resolveName | back to summary |
|---|---|
| protected Object resolveName(String name, MethodParameter parameter, NativeWebRequest request) throws Exception Implements abstract org. Doc from org. Resolve the given parameter type and value name into an argument value.
| |
| supportsParameter | back to summary |
|---|---|
| public boolean supportsParameter(MethodParameter parameter) Implements org. Doc from org. Whether this contributor supports the given method parameter.
| |
| Access | Constructor and Description |
|---|---|
| public |
| PathVariableNamedValueInfo | back to summary |
|---|---|
| public PathVariableNamedValueInfo(PathVariable annotation) | |