Package io.awspring.cloud.sqs.config
Class DefaultMethodPayloadTypeInferrer
java.lang.Object
io.awspring.cloud.sqs.config.DefaultMethodPayloadTypeInferrer
- All Implemented Interfaces:
MethodPayloadTypeInferrer
Default implementation of
MethodPayloadTypeInferrer that infers the payload type by analyzing method
parameters and their associated argument resolvers.
The inference strategy:
- If a parameter is explicitly annotated with
Payload, it is considered the payload - Otherwise, the first parameter that is not supported by any non-payload resolver is considered the payload
Non-payload resolvers are those that handle framework-specific types like acknowledgements, headers, visibility, or user-provided resolvers for custom types. Payload resolvers handle the actual message payload.
- Since:
- 3.4.3
- Author:
- Tomaz Fernandes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable Class<?>inferPayloadType(Method method, List<HandlerMethodArgumentResolver> argumentResolvers) Infer the payload class from the given method and its argument resolvers.
-
Constructor Details
-
DefaultMethodPayloadTypeInferrer
public DefaultMethodPayloadTypeInferrer()
-
-
Method Details
-
inferPayloadType
public @Nullable Class<?> inferPayloadType(Method method, List<HandlerMethodArgumentResolver> argumentResolvers) Description copied from interface:MethodPayloadTypeInferrerInfer the payload class from the given method and its argument resolvers.- Specified by:
inferPayloadTypein interfaceMethodPayloadTypeInferrer- Parameters:
method- the listener methodargumentResolvers- the argument resolvers available for this method, may be null or empty- Returns:
- the inferred payload class, or null if it cannot be determined
-