Package org.springframework.web.method.annotation

# Interface HandlerMethodValidationException.Visitor

Enclosing class:
  HandlerMethodValidationException

public static interface HandlerMethodValidationException.Visitor
Contract to handle validation results with callbacks by controller method parameter type, with `other(org.springframework.validation.method.ParameterValidationResult)` serving as the fallthrough.

## Method Summary

Modifier and Type
Method
Description
`void`
`cookieValue(CookieValue cookieValue, org.springframework.validation.method.ParameterValidationResult result)`
Handle results for `@CookieValue` method parameters.
`void`
`matrixVariable(MatrixVariable matrixVariable, org.springframework.validation.method.ParameterValidationResult result)`
Handle results for `@MatrixVariable` method parameters.
`void`
`modelAttribute(ModelAttribute modelAttribute, org.springframework.validation.method.ParameterErrors errors)`
Handle results for `@ModelAttribute` method parameters.
`void`
`other(org.springframework.validation.method.ParameterValidationResult result)`
Handle other results that aren't any of the above.
`void`
`pathVariable(PathVariable pathVariable, org.springframework.validation.method.ParameterValidationResult result)`
Handle results for `@PathVariable` method parameters.
`void`
`requestBody(RequestBody requestBody, org.springframework.validation.method.ParameterErrors errors)`
Handle results for `@RequestBody` method parameters.
`default void`
`requestBodyValidationResult(RequestBody requestBody, org.springframework.validation.method.ParameterValidationResult result)`
An additional `@RequestBody` callback for validation failures for constraints on the method parameter.
`void`
`requestHeader(RequestHeader requestHeader, org.springframework.validation.method.ParameterValidationResult result)`
Handle results for `@RequestHeader` method parameters.
`void`
`requestParam(RequestParam requestParam, org.springframework.validation.method.ParameterValidationResult result)`
Handle results for `@RequestParam` method parameters.
`void`
`requestPart(RequestPart requestPart, org.springframework.validation.method.ParameterErrors errors)`
Handle results for `@RequestPart` method parameters.

## Method Details

### cookieValue

void cookieValue(CookieValue cookieValue, org.springframework.validation.method.ParameterValidationResult result)
Handle results for `@CookieValue` method parameters.

Parameters:
  `cookieValue` - the annotation declared on the parameter
  `result` - the validation result

### matrixVariable

void matrixVariable(MatrixVariable matrixVariable, org.springframework.validation.method.ParameterValidationResult result)
Handle results for `@MatrixVariable` method parameters.

Parameters:
  `matrixVariable` - the annotation declared on the parameter
  `result` - the validation result

### modelAttribute

void modelAttribute(@Nullable ModelAttribute modelAttribute, org.springframework.validation.method.ParameterErrors errors)
Handle results for `@ModelAttribute` method parameters.

Parameters:
  `modelAttribute` - the optional `ModelAttribute` annotation, possibly `null` if the method parameter is declared without it.
  `errors` - the validation errors

### pathVariable

void pathVariable(PathVariable pathVariable, org.springframework.validation.method.ParameterValidationResult result)
Handle results for `@PathVariable` method parameters.

Parameters:
  `pathVariable` - the annotation declared on the parameter
  `result` - the validation result

### requestBody

void requestBody(RequestBody requestBody, org.springframework.validation.method.ParameterErrors errors)
Handle results for `@RequestBody` method parameters.

Parameters:
  `requestBody` - the annotation declared on the parameter
  `errors` - the validation error

### requestBodyValidationResult

default void requestBodyValidationResult(RequestBody requestBody, org.springframework.validation.method.ParameterValidationResult result)
An additional `@RequestBody` callback for validation failures for constraints on the method parameter. For example:

     @RequestBody List<@NotEmpty String> ids

Handle results for `@RequestBody` method parameters.

Parameters:
  `requestBody` - the annotation declared on the parameter
  `result` - the validation result
Since:
  6.2.4

### requestHeader

void requestHeader(RequestHeader requestHeader, org.springframework.validation.method.ParameterValidationResult result)
Handle results for `@RequestHeader` method parameters.

Parameters:
  `requestHeader` - the annotation declared on the parameter
  `result` - the validation result

### requestParam

void requestParam(@Nullable RequestParam requestParam, org.springframework.validation.method.ParameterValidationResult result)
Handle results for `@RequestParam` method parameters.

Parameters:
  `requestParam` - the optional `RequestParam` annotation, possibly `null` if the method parameter is declared without it.
  `result` - the validation result

### requestPart

void requestPart(RequestPart requestPart, org.springframework.validation.method.ParameterErrors errors)
Handle results for `@RequestPart` method parameters.

Parameters:
  `requestPart` - the annotation declared on the parameter
  `errors` - the validation errors

### other

void other(org.springframework.validation.method.ParameterValidationResult result)
Handle other results that aren't any of the above.

Parameters:
  `result` - the validation result