public class Message extends Packet
| Message type | |||||
| Field | Normal | Chat | Group Chat | Headline | XMPPError |
| subject | SHOULD | SHOULD NOT | SHOULD NOT | SHOULD NOT | SHOULD NOT |
| thread | OPTIONAL | SHOULD | OPTIONAL | OPTIONAL | SHOULD NOT |
| body | SHOULD | SHOULD | SHOULD | SHOULD | SHOULD NOT |
| error | MUST NOT | MUST NOT | MUST NOT | MUST NOT | MUST |
| Modifier and Type | Class and Description |
|---|---|
static class |
Message.Type
Represents the type of a message.
|
ID_NOT_AVAILABLE| Constructor and Description |
|---|
Message()
Creates a new, "normal" message.
|
Message(java.lang.String to)
Creates a new "normal" message to the specified recipient.
|
Message(java.lang.String to,
Message.Type type)
Creates a new message of the specified type to a recipient.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getBody()
Returns the body of the message, or null if the body has not been set.
|
java.lang.String |
getSubject()
Returns the subject of the message, or null if the subject has not been set.
|
java.lang.String |
getThread()
Returns the thread id of the message, which is a unique identifier for a sequence
of "chat" messages.
|
Message.Type |
getType()
Returns the type of the message.
|
void |
setBody(java.lang.String body)
Sets the body of the message.
|
void |
setSubject(java.lang.String subject)
Sets the subject of the message.
|
void |
setThread(java.lang.String thread)
Sets the thread id of the message, which is a unique identifier for a sequence
of "chat" messages.
|
void |
setType(Message.Type type)
Sets the type of the message.
|
java.lang.String |
toXML()
Returns the packet as XML.
|
addExtension, deleteProperty, getError, getExtension, getExtensions, getExtensionsXML, getFrom, getPacketID, getProperty, getPropertyNames, getTo, removeExtension, setError, setFrom, setPacketID, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setTopublic Message()
public Message(java.lang.String to)
to - the recipient of the message.public Message(java.lang.String to,
Message.Type type)
to - the user to send the message to.type - the message type.public Message.Type getType()
public void setType(Message.Type type)
type - the type of the message.public java.lang.String getSubject()
public void setSubject(java.lang.String subject)
subject - the subject of the message.public java.lang.String getBody()
public void setBody(java.lang.String body)
body - public java.lang.String getThread()
public void setThread(java.lang.String thread)
thread - the thread id of the message.public java.lang.String toXML()
PacketCopyright © 2003 Jive Software.