Class PayloadParameterResolver

java.lang.Object
org.axonframework.messaging.annotation.PayloadParameterResolver
All Implemented Interfaces:
ParameterResolver

public class PayloadParameterResolver extends Object implements ParameterResolver
Implementation of a ParameterResolver that resolves the Message payload as parameter in a handler method.
  • Constructor Details

    • PayloadParameterResolver

      public PayloadParameterResolver(Class<?> payloadType)
      Initializes a new 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.
      Parameters:
      payloadType - the parameter type
  • Method Details

    • resolveParameterValue

      public Object resolveParameterValue(Message message)
      Description copied from interface: ParameterResolver
      Resolves the parameter value to use for the given message, or null if no suitable parameter value can be resolved.
      Specified by:
      resolveParameterValue in interface ParameterResolver
      Parameters:
      message - The message to resolve the value from
      Returns:
      the parameter value for the handler
    • matches

      public boolean matches(Message message)
      Description copied from interface: ParameterResolver
      Indicates whether this resolver is capable of providing a value for the given message.
      Specified by:
      matches in interface ParameterResolver
      Parameters:
      message - The message to evaluate
      Returns:
      true if this resolver can provide a value for the message, otherwise false
    • supportedPayloadType

      public Class<?> supportedPayloadType()
      Description copied from interface: ParameterResolver
      Returns the class of the payload that is supported by this resolver. Defaults to the Object class indicating that the payload type is irrelevant for this resolver.
      Specified by:
      supportedPayloadType in interface ParameterResolver
      Returns:
      The class of the payload that is supported by this resolver