MessageConverter.
Validation is applied if the method argument is annotated with
org. or
@jakarta.validation.Valid. Validation failure results in an
MethodArgumentNotValidException.
This HandlerMethodArgumentResolver should be ordered last as it
supports all types and does not require the Payload annotation.
| Modifier and Type | Field and Description |
|---|---|
| private final MessageConverter | |
| private final boolean | |
| private final Validator |
| Access | Constructor and Description |
|---|---|
| public | PayloadMethodArgumentResolver(MessageConverter
the MessageConverter to use (required) messageConverter)Create a new |
| public | PayloadMethodArgumentResolver(MessageConverter
the MessageConverter to use (required) messageConverter, Validator the Validator to use (optional) validator)Create a new |
| public | PayloadMethodArgumentResolver(MessageConverter
the MessageConverter to use (required) messageConverter, Validator the Validator to use (optional) validator, boolean if "true" (the default) this resolver supports
all parameters; if "false" then only arguments with the useDefaultResolution)@Payload
annotation are supported.Create a new |
| Modifier and Type | Method and Description |
|---|---|
| private String | |
| protected boolean | isEmptyPayload(Object
the payload to check (can be payload)null)Specify if the given |
| public Object | resolveArgument(MethodParameter
the method parameter to resolve.
This parameter must have previously been passed to
parameter, Message<?> supportsParameter(org.
which must have returned true.the currently processed message message)Implements org. Resolves a method parameter into an argument value from a given message. |
| protected Class | Returns: the target type to usethe target method parameter parameter, Message<?> the message being processed message)Resolve the target class to convert the payload to. |
| public boolean | supportsParameter(MethodParameter
the method parameter to check parameter)Implements org. Whether the given method parameter is supported by this resolver. |
| protected void | validate(Message<?>
the currently processed message message, MethodParameter the method parameter parameter, Object the target payload object target)Validate the payload if applicable. |
| converter | back to summary |
|---|---|
| private final MessageConverter converter | |
| useDefaultResolution | back to summary |
|---|---|
| private final boolean useDefaultResolution | |
| validator | back to summary |
|---|---|
| private final Validator validator
| |
| PayloadMethodArgumentResolver | back to summary |
|---|---|
| public PayloadMethodArgumentResolver(MessageConverter messageConverter) Create a new
| |
| PayloadMethodArgumentResolver | back to summary |
|---|---|
| public PayloadMethodArgumentResolver(MessageConverter messageConverter, Validator validator) Create a new
| |
| PayloadMethodArgumentResolver | back to summary |
|---|---|
| public PayloadMethodArgumentResolver(MessageConverter messageConverter, Validator validator, boolean useDefaultResolution) Create a new
| |
| getParameterName | back to summary |
|---|---|
| private String getParameterName(MethodParameter param) | |
| isEmptyPayload | back to summary |
|---|---|
| protected boolean isEmptyPayload(Object payload) Specify if the given
| |
| resolveArgument | back to summary |
|---|---|
| public Object resolveArgument(MethodParameter parameter, Message<?> message) throws Exception Implements org. Doc from org. Resolves a method parameter into an argument value from a given message.
| |
| resolveTargetClass | back to summary |
|---|---|
| protected Class Resolve the target class to convert the payload to. By default this is simply
| |
| supportsParameter | back to summary |
|---|---|
| public boolean supportsParameter(MethodParameter parameter) Implements org. Doc from org. Whether the given method parameter is supported by this resolver.
| |
| validate | back to summary |
|---|---|
| protected void validate(Message<?> message, MethodParameter parameter, Object target) Validate the payload if applicable.
| |