Package org.springframework.web.method.annotation

# Class MethodArgumentTypeMismatchException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.beans.BeansException
org.springframework.beans.PropertyAccessException
org.springframework.beans.TypeMismatchException
org.springframework.web.method.annotation.MethodArgumentTypeMismatchException

All Implemented Interfaces:
  `Serializable`

public class MethodArgumentTypeMismatchException extends org.springframework.beans.TypeMismatchException
A TypeMismatchException raised while resolving a controller method argument. Provides access to the target `MethodParameter`.

Since:
  4.2
Author:
  Rossen Stoyanchev
See Also:
  - Serialized Form

## Field Summary

### Fields inherited from class org.springframework.beans.TypeMismatchException

`ERROR_CODE`

## Constructor Summary

Constructors
Constructor
Description
`MethodArgumentTypeMismatchException(Object value, Class<?> requiredType, String name, org.springframework.core.MethodParameter param, Throwable cause)`

## Method Summary

Modifier and Type
Method
Description
`String`
`getMessage()`
`String`
`getName()`
Return the name of the method argument.
`org.springframework.core.MethodParameter`
`getParameter()`
Return the target method parameter.

### Methods inherited from class org.springframework.beans.TypeMismatchException

`getErrorCode, getPropertyName, getRequiredType, getValue, initPropertyName`

### Methods inherited from class org.springframework.beans.PropertyAccessException

`getPropertyChangeEvent`

### Methods inherited from class org.springframework.core.NestedRuntimeException

`contains, getMostSpecificCause, getRootCause`

### Methods inherited from class java.lang.Throwable

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### MethodArgumentTypeMismatchException

public MethodArgumentTypeMismatchException(@Nullable Object value, @Nullable Class<?> requiredType, String name, org.springframework.core.MethodParameter param, @Nullable Throwable cause)

## Method Details

### getName

public String getName()
Return the name of the method argument.

### getParameter

public org.springframework.core.MethodParameter getParameter()
Return the target method parameter.

### getMessage

public String getMessage()

Overrides:
  `getMessage` in class `Throwable`