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 Summary
Fields Modifier and Type Field Description static org.springframework.util.MimeType
X_JAVA_OBJECT
A general MimeType for Java Types.static org.springframework.util.MimeType
X_JAVA_SERIALIZED_OBJECT
A general MimeType for a Java serialized byte array.
-
Constructor Summary
Constructors Constructor Description MessageConverterUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Class<?>
getJavaTypeForJavaObjectContentType(org.springframework.util.MimeType contentType)
Get the java Object type for the MimeType X_JAVA_OBJECT.static org.springframework.util.MimeType
getMimeType(String contentTypeString)
static org.springframework.util.MimeType
javaObjectMimeType(Class<?> clazz)
Build the conventionalMimeType
for a java object.static org.springframework.util.MimeType
resolveContentType(String type)
static Class<?>
resolveJavaType(String type)
-
-
-
Method Detail
-
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 conventionalMimeType
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
-
-