47.3. Methods

The TextMessage interface inherits the fields and the methods of the interface javax.jms.Message. The following methods are defined in the interface javax.jms.TextMessage.

getText

public java.lang.String getText()

Gets the string containing this message's data. The default value is null.

RETURNS:

the String containing the message's data

THROWS:

JMSException if the JMS provider fails to get the text due to some internal error

setText

public void setText(java.lang.String string)

Sets the string containing this message's data.

PARAMETERS:

string the String containing the message's data

THROWS:

JMSException if the JMS provider fails to set the text due to some internal error
MessageNotWriteableException if the message is in read-only ...

Get Java™ Message Service API Tutorial and Reference: Messaging for the J2EE™ Platform now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.