public class PayloadParameterResolver extends Object implements ParameterResolver
ParameterResolver
that resolves the Message payload as parameter in a handler method.Constructor and Description |
---|
PayloadParameterResolver(Class<?> payloadType)
Initializes a new
PayloadParameterResolver for a method parameter of given payloadType . |
Modifier and Type | Method and Description |
---|---|
boolean |
matches(Message message)
Indicates whether this resolver is capable of providing a value for the given
message . |
Object |
resolveParameterValue(Message message)
Resolves the parameter value to use for the given
message , or null if no suitable
parameter value can be resolved. |
Class<?> |
supportedPayloadType()
Returns the class of the payload that is supported by this resolver.
|
public PayloadParameterResolver(Class<?> payloadType)
PayloadParameterResolver
for a method parameter of given payloadType
. This
parameter resolver matches with a message if the payload of the message is assignable to the given payloadType
.payloadType
- the parameter typepublic Object resolveParameterValue(Message message)
ParameterResolver
message
, or null
if no suitable
parameter value can be resolved.resolveParameterValue
in interface ParameterResolver
message
- The message to resolve the value frompublic boolean matches(Message message)
ParameterResolver
message
.matches
in interface ParameterResolver
message
- The message to evaluatetrue
if this resolver can provide a value for the message, otherwise false
public Class<?> supportedPayloadType()
ParameterResolver
Object
class
indicating that the payload type is irrelevant for this resolver.supportedPayloadType
in interface ParameterResolver
Copyright © 2010–2023. All rights reserved.