HDR - the generic type@StampyLibrary(libraryName="stampy-core") public abstract class AbstractBodyMessage<HDR extends AbstractBodyMessageHeader> extends AbstractMessage<HDR>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
JAVA_BASE64_MIME_TYPE
The Constant JAVA_BASE64_MIME_TYPE.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractBodyMessage(StompMessageType messageType)
Instantiates a new abstract body message.
|
| Modifier and Type | Method and Description |
|---|---|
<O> O |
getBody()
Gets the body.
|
java.lang.String |
getBodyEncoding()
Gets the body encoding.
|
java.lang.String |
getObjectArrayAsBase64(java.lang.Object o)
Gets the object array as base64.
|
protected java.lang.String |
getObjectArrayAsString(java.lang.Object body)
Should the
getBodyEncoding() return a value
other than JAVA_BASE64_MIME_TYPE, this method
will be invoked. |
boolean |
isText()
Checks if is text.
|
protected java.lang.String |
postHeader()
This method is used to create the body of the message, if applicable.
|
<O> void |
setBody(O body)
Sets the body.
|
void |
setBodyEncoding(java.lang.String bodyEncoding)
Sets the body encoding.
|
void |
setMimeType(java.lang.String mimeType)
Sets the mime type.
|
void |
setMimeType(java.lang.String mimeType,
java.lang.String encoding)
Sets the mime type.
|
createNewHeader, equals, getHeader, getMessageType, hashCode, toStompMessage, toString, validatepublic static final java.lang.String JAVA_BASE64_MIME_TYPE
protected AbstractBodyMessage(StompMessageType messageType)
messageType - the message typepublic <O> O getBody()
O - the generic typepublic <O> void setBody(O body)
O - the generic typebody - the new bodypublic void setMimeType(java.lang.String mimeType)
mimeType - the new mime typepublic void setMimeType(java.lang.String mimeType,
java.lang.String encoding)
mimeType - the mime typeencoding - the encodingpublic boolean isText()
protected java.lang.String postHeader()
AbstractMessagepostHeader in class AbstractMessage<HDR extends AbstractBodyMessageHeader>protected java.lang.String getObjectArrayAsString(java.lang.Object body)
getBodyEncoding() return a value
other than JAVA_BASE64_MIME_TYPE, this method
will be invoked. The default implementation throws a
NotImplementedException. Override as necessary.body - the bodypublic java.lang.String getObjectArrayAsBase64(java.lang.Object o)
throws java.io.IOException
o - the ojava.io.IOException - Signals that an I/O exception has occurred.public java.lang.String getBodyEncoding()
JAVA_BASE64_MIME_TYPE.public void setBodyEncoding(java.lang.String bodyEncoding)
bodyEncoding - the new body encoding