javax.wireless.messaging
Interface TextMessage

All Superinterfaces:
Message

public interface TextMessage
extends Message

An interface representing a text message. This is a subinterface of Message which contains methods to get and set the text payload. The setPayloadText(String) method sets the value of the payload in the data container without any checking whether the value is valid in any way. Methods for manipulating the address portion of the message are inherited from Message.

Object instances implementing this interface are just containers for the data that is passed in.

Character Encoding Considerations

Text messages using this interface deal with strings encoded in Java. The underlying implementation will convert the strings into a suitable encoding for the messaging protocol in question. Different protocols recognize different character sets. To ensure that characters are transmitted correctly across the network, an application should use the character set(s) recognized by the protocol. If an application is unaware of the protocol, or uses a character set that the protocol does not recognize, then some characters might be transmitted incorrectly.

This interface is defined in JSR 205: Wireless Messaging API 2.0, which extends and enhances JSR 120: Wireless Messaging API

Since:
JDE 4.0.0

Method Summary
 String getPayloadText()
          Returns the message payload data as a String.
 void setPayloadText(String data)
          Sets the payload data of this message.
 
Methods inherited from interface javax.wireless.messaging.Message
getAddress, getTimestamp, setAddress
 

Method Detail

getPayloadText

public String getPayloadText()
Returns the message payload data as a String.
Returns:
the payload of this message, or null if the payload for the message is not set.
Since:
JDE 4.0.0
See Also:
setPayloadText(String)

setPayloadText

public void setPayloadText(String data)
Sets the payload data of this message. The payload data may be null.
Parameters:
data - payload data as a String.
Since:
JDE 4.0.0
See Also:
getPayloadText()



Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.