Class MarshallingMessageConverter

    • Constructor Detail

      • MarshallingMessageConverter

        public MarshallingMessageConverter()
        Construct a new MarshallingMessageConverter with no Marshaller or Unmarshaller set. The marshaller must be set after construction by invoking setMarshaller(Marshaller) and setUnmarshaller(Unmarshaller) .
      • MarshallingMessageConverter

        public MarshallingMessageConverter​(org.springframework.oxm.Marshaller marshaller)
        Construct a new MarshallingMessageConverter with the given Marshaller set.

        If the given Marshaller also implements the Unmarshaller interface, it is used for both marshalling and unmarshalling. Otherwise, an exception is thrown.

        Note that all Marshaller implementations in Spring also implement the Unmarshaller interface, so that you can safely use this constructor.

        Parameters:
        marshaller - object used as marshaller and unmarshaller
        Throws:
        java.lang.IllegalArgumentException - when marshaller does not implement the Unmarshaller interface as well
      • MarshallingMessageConverter

        public MarshallingMessageConverter​(org.springframework.oxm.Marshaller marshaller,
                                           org.springframework.oxm.Unmarshaller unmarshaller)
        Construct a new MarshallingMessageConverter with the given Marshaller and Unmarshaller.
        Parameters:
        marshaller - the Marshaller to use
        unmarshaller - the Unmarshaller to use
    • Method Detail

      • setContentType

        public void setContentType​(@Nullable
                                   java.lang.String contentType)
        Set the contentType to be used by this message converter.
        Parameters:
        contentType - The content type.
      • setMarshaller

        public void setMarshaller​(org.springframework.oxm.Marshaller marshaller)
        Set the Marshaller to be used by this message converter.
        Parameters:
        marshaller - The marshaller.
      • setUnmarshaller

        public void setUnmarshaller​(org.springframework.oxm.Unmarshaller unmarshaller)
        Set the Unmarshaller to be used by this message converter.
        Parameters:
        unmarshaller - The unmarshaller.
      • afterPropertiesSet

        public void afterPropertiesSet()
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean