Class MessageConverterUtils

java.lang.Object
org.springframework.cloud.stream.converter.MessageConverterUtils

public abstract class MessageConverterUtils extends Object
Message conversion utility methods.
Author:
David Turanski, Gary Russell, Ilayaperumal Gopinathan
  • Field Details

    • X_JAVA_OBJECT

      public static final org.springframework.util.MimeType X_JAVA_OBJECT
      A general MimeType for Java Types.
    • X_JAVA_SERIALIZED_OBJECT

      public static final org.springframework.util.MimeType X_JAVA_SERIALIZED_OBJECT
      A general MimeType for a Java serialized byte array.
  • Constructor Details

    • MessageConverterUtils

      public MessageConverterUtils()
  • Method Details

    • getJavaTypeForJavaObjectContentType

      public static Class<?> getJavaTypeForJavaObjectContentType(org.springframework.util.MimeType contentType)
      Get the java Object type for the MimeType X_JAVA_OBJECT.
      Parameters:
      contentType - content type
      Returns:
      the class for the content type.
    • javaObjectMimeType

      public static org.springframework.util.MimeType javaObjectMimeType(Class<?> clazz)
      Build the conventional MimeType for a java object.
      Parameters:
      clazz - the java type
      Returns:
      the MIME type
    • getMimeType

      public static org.springframework.util.MimeType getMimeType(String contentTypeString)
    • resolveContentType

      public static org.springframework.util.MimeType resolveContentType(String type) throws ClassNotFoundException, LinkageError
      Throws:
      ClassNotFoundException
      LinkageError
    • resolveJavaType

      public static Class<?> resolveJavaType(String type) throws ClassNotFoundException, LinkageError
      Throws:
      ClassNotFoundException
      LinkageError