org.springframework.messaging.converter

Class GenericMessageConverter

    • Constructor Detail

      • GenericMessageConverter

        public GenericMessageConverter()
        Create a new instance with a default ConversionService.
    • Method Detail

      • fromMessage

        @Nullable
        public java.lang.Object fromMessage(Message<?> message,
                                                      java.lang.Class<?> targetClass)
        Description copied from interface: MessageConverter
        Convert the payload of a Message from a serialized form to a typed Object of the specified target class. The MessageHeaders.CONTENT_TYPE header should indicate the MIME type to convert from.

        If the converter does not support the specified media type or cannot perform the conversion, it should return null.

        Specified by:
        fromMessage in interface MessageConverter
        Overrides:
        fromMessage in class SimpleMessageConverter
        Parameters:
        message - the input message
        targetClass - the target class for the conversion
        Returns:
        the result of the conversion, or null if the converter cannot perform the conversion