Class XmlRootElementPayloadMethodProcessor

All Implemented Interfaces:
MethodArgumentResolver, MethodReturnValueHandler

public class XmlRootElementPayloadMethodProcessor extends AbstractJaxb2PayloadMethodProcessor
Implementation of MethodArgumentResolver and MethodReturnValueHandler that supports parameters annotated with @XmlRootElement or @XmlType, and return values annotated with @XmlRootElement.
Since:
2.0
Author:
Arjen Poutsma
  • Constructor Details

    • XmlRootElementPayloadMethodProcessor

      public XmlRootElementPayloadMethodProcessor()
  • Method Details

    • supportsRequestPayloadParameter

      protected boolean supportsRequestPayloadParameter(org.springframework.core.MethodParameter parameter)
      Description copied from class: AbstractPayloadMethodProcessor
      Indicates whether the given method parameter, annotated with RequestPayload, is supported by this resolver.
      Specified by:
      supportsRequestPayloadParameter in class AbstractPayloadMethodProcessor
      Parameters:
      parameter - the method parameter to check
      Returns:
      true if this resolver supports the supplied parameter; false otherwise
    • resolveArgument

      public Object resolveArgument(MessageContext messageContext, org.springframework.core.MethodParameter parameter) throws jakarta.xml.bind.JAXBException
      Description copied from interface: MethodArgumentResolver
      Resolves the given parameter into a method argument.
      Parameters:
      messageContext - the current message context
      parameter - the parameter to resolve to an argument. This parameter must have previously been passed to the MethodArgumentResolver.supportsParameter(MethodParameter) method of this interface, which must have returned true.
      Returns:
      the resolved argument. May be null.
      Throws:
      jakarta.xml.bind.JAXBException
    • supportsResponsePayloadReturnType

      protected boolean supportsResponsePayloadReturnType(org.springframework.core.MethodParameter returnType)
      Description copied from class: AbstractPayloadMethodProcessor
      Indicates whether the given method return type, annotated with ResponsePayload, is supported.
      Specified by:
      supportsResponsePayloadReturnType in class AbstractPayloadMethodProcessor
      Parameters:
      returnType - the method parameter to check
      Returns:
      true if this resolver supports the supplied return type; false otherwise
    • handleReturnValueInternal

      protected void handleReturnValueInternal(MessageContext messageContext, org.springframework.core.MethodParameter returnType, Object returnValue) throws jakarta.xml.bind.JAXBException
      Specified by:
      handleReturnValueInternal in class AbstractJaxb2PayloadMethodProcessor
      Throws:
      jakarta.xml.bind.JAXBException