Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| The Spring Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.springframework.web.bind.support
Interface WebArgumentResolver

    public interface WebArgumentResolver

SPI for resolving custom arguments for a specific handler method parameter. Typically implemented to detect sppecial parameter types, resolving well-known argument values for them.

A typical implementation could look like as follows:

     private static class MySpecialArgumentResolver implements ArgumentResolver {

       public Object resolveArgument(NativeWebRequest webRequest, MethodParameter methodParameter) {
         if (methodParameter.getParameterType().equals(MySpecialArg.class)) {
           return new MySpecialArg("myValue");
         }
         return UNRESOLVED;
       }
     }

Since:
  2.5.2
Author:
  Juergen Hoeller
See Also:
  `AnnotationMethodHandlerAdapter.setCustomArgumentResolvers(org.springframework.web.bind.support.WebArgumentResolver[])`, `AnnotationMethodHandlerAdapter.setCustomArgumentResolvers(org.springframework.web.bind.support.WebArgumentResolver[])`

Field Summary
`static Object` | `UNRESOLVED` Marker to be returned when the resolver does not know how to handle the given method parameter.

Method Summary
`Object` | `resolveArgument(MethodParameter methodParameter, NativeWebRequest webRequest)` Resolve an argument for the given handler method parameter within the given web request.

Field Detail

### UNRESOLVED

    static final Object UNRESOLVED

  Marker to be returned when the resolver does not know how to handle the given method parameter.

Method Detail

### resolveArgument

    Object resolveArgument(MethodParameter methodParameter,
                           NativeWebRequest webRequest)
                           throws Exception

  Resolve an argument for the given handler method parameter within the given web request.

  Parameters:
    `methodParameter` - the handler method parameter to resolve
    `webRequest` - the current web request, allowing access to the native request as well
  Returns:
    the argument value, or `UNRESOLVED` if not resolvable
  Throws:
    `Exception` - in case of resolution failure

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| The Spring Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2008 The Spring Framework.