public final class Message extends MessageOrPresence<MessageBuilder> implements MessageView
| 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.Body
Represents a message body, its language and the content of the message.
|
static class |
Message.Subject
Represents a message subject, its language and the content of the subject.
|
static class |
Message.Thread |
static class |
Message.Type
Represents the type of a message.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BODY |
static java.lang.String |
ELEMENT |
DEFAULT_LANGUAGE, ITEM, language, TEXT| Constructor and Description |
|---|
Message()
Deprecated.
use
StanzaBuilder, preferable via StanzaFactory, instead. |
Message(org.jxmpp.jid.Jid to)
Deprecated.
use
StanzaBuilder, preferable via StanzaFactory, instead. |
Message(org.jxmpp.jid.Jid to,
ExtensionElement extensionElement)
Deprecated.
use
StanzaBuilder, preferable via StanzaFactory, instead. |
Message(org.jxmpp.jid.Jid to,
Message.Type type)
Deprecated.
use
StanzaBuilder, preferable via StanzaFactory, instead. |
Message(org.jxmpp.jid.Jid to,
java.lang.String body)
Deprecated.
use
StanzaBuilder, preferable via StanzaFactory, instead. |
Message(Message other)
Copy constructor.
|
Message(java.lang.String to,
java.lang.String body)
Deprecated.
use
StanzaBuilder, preferable via StanzaFactory, instead. |
| Modifier and Type | Method and Description |
|---|---|
Message.Body |
addBody(java.lang.String language,
java.lang.String body)
Deprecated.
use
StanzaBuilder instead. |
Message.Subject |
addSubject(java.lang.String language,
java.lang.String subject)
Deprecated.
|
MessageBuilder |
asBuilder() |
MessageBuilder |
asBuilder(java.lang.String id) |
MessageBuilder |
asBuilder(XMPPConnection connection) |
Message |
clone()
Deprecated.
use
asBuilder() instead. |
java.lang.String |
getElementName()
Returns the root element name.
|
Message.Type |
getType()
Returns the type of the message.
|
boolean |
removeBody(Message.Body body)
Deprecated.
use
StanzaBuilder instead. |
boolean |
removeBody(java.lang.String language)
Deprecated.
use
StanzaBuilder instead. |
boolean |
removeSubject(Message.Subject subject)
Deprecated.
|
boolean |
removeSubject(java.lang.String language)
Deprecated.
|
void |
setBody(java.lang.CharSequence body)
Deprecated.
use
StanzaBuilder instead. |
void |
setBody(java.lang.String body)
Deprecated.
use
StanzaBuilder instead. |
void |
setSubject(java.lang.String subject)
Deprecated.
use
StanzaBuilder instead. |
void |
setThread(java.lang.String thread)
Deprecated.
use
StanzaBuilder instead. |
void |
setType(Message.Type type)
Deprecated.
use
StanzaBuilder instead. |
java.lang.String |
toString()
Returns a short String describing the Stanza.
|
XmlStringBuilder |
toXML(XmlEnvironment enclosingXmlEnvironment) |
addCommonAttributes, addExtension, addExtensions, appendErrorIfExists, getDefaultLanguage, getError, getExtension, getExtension, getExtension, getExtensionElement, getExtensions, getExtensions, getExtensions, getExtensions, getExtensionsMap, getFrom, getLanguage, getNamespace, getStanzaId, getTo, hasExtension, hasExtension, hasStanzaIdSet, logCommonAttributes, overrideExtension, removeExtension, removeExtension, setError, setError, setFrom, setLanguage, setNewStanzaId, setStanzaId, setStanzaId, setTo, throwIfNoStanzaIdequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetBodies, getBody, getBody, getBodyLanguages, getMessageBody, getMessageSubject, getSubject, getSubject, getSubjectLanguages, getSubjects, getThreadgetError, getExtension, getExtension, getExtensions, getExtensions, getExtensions, getFrom, getStanzaId, getTo, hasExtension, hasExtension, hasExtensiongetLanguagegetQNamepublic static final java.lang.String ELEMENT
public static final java.lang.String BODY
@Deprecated public Message()
StanzaBuilder, preferable via StanzaFactory, instead.@Deprecated public Message(org.jxmpp.jid.Jid to)
StanzaBuilder, preferable via StanzaFactory, instead.to - the recipient of the message.@Deprecated
public Message(org.jxmpp.jid.Jid to,
Message.Type type)
StanzaBuilder, preferable via StanzaFactory, instead.to - the user to send the message to.type - the message type.@Deprecated
public Message(org.jxmpp.jid.Jid to,
java.lang.String body)
StanzaBuilder, preferable via StanzaFactory, instead.to - the user to send the message to.body - the body of the message.@Deprecated
public Message(java.lang.String to,
java.lang.String body)
throws org.jxmpp.stringprep.XmppStringprepException
StanzaBuilder, preferable via StanzaFactory, instead.to - the user to send the message to.body - the body of the message.org.jxmpp.stringprep.XmppStringprepException - if 'to' is not a valid XMPP address.@Deprecated
public Message(org.jxmpp.jid.Jid to,
ExtensionElement extensionElement)
StanzaBuilder, preferable via StanzaFactory, instead.to - TODO javadoc me pleaseextensionElement - TODO javadoc me pleasepublic Message(Message other)
This does not perform a deep clone, as extension elements are shared between the new and old instance.
other - TODO javadoc me pleasepublic Message.Type getType()
MessageViewMessage.Type.normal.getType in interface MessageView@Deprecated public void setType(Message.Type type)
StanzaBuilder instead.type - the type of the message.@Deprecated public void setSubject(java.lang.String subject)
StanzaBuilder instead.subject - the subject of the message.@Deprecated public Message.Subject addSubject(java.lang.String language, java.lang.String subject)
language - the language of the subject being added.subject - the subject being added to the message.Message.Subjectjava.lang.NullPointerException - if the subject is null, a null pointer exception is thrown@Deprecated public boolean removeSubject(java.lang.String language)
language - the language of the subject which is to be removed@Deprecated public boolean removeSubject(Message.Subject subject)
subject - the subject being removed from the message.@Deprecated public void setBody(java.lang.CharSequence body)
StanzaBuilder instead.body - the body of the message.setBody(String)@Deprecated public void setBody(java.lang.String body)
StanzaBuilder instead.body - the body of the message.@Deprecated public Message.Body addBody(java.lang.String language, java.lang.String body)
StanzaBuilder instead.language - the language of the body being added.body - the body being added to the message.Message.Bodyjava.lang.NullPointerException - if the body is null, a null pointer exception is thrown@Deprecated public boolean removeBody(java.lang.String language)
StanzaBuilder instead.language - the language of the body which is to be removed@Deprecated public boolean removeBody(Message.Body body)
StanzaBuilder instead.body - the body being removed from the message.@Deprecated public void setThread(java.lang.String thread)
StanzaBuilder instead.thread - the thread id of the message.public java.lang.String getElementName()
NamedElementgetElementName in interface NamedElementpublic MessageBuilder asBuilder()
asBuilder in class MessageOrPresence<MessageBuilder>public MessageBuilder asBuilder(java.lang.String id)
asBuilder in class MessageOrPresence<MessageBuilder>public MessageBuilder asBuilder(XMPPConnection connection)
asBuilder in class MessageOrPresence<MessageBuilder>public java.lang.String toString()
Stanzapublic XmlStringBuilder toXML(XmlEnvironment enclosingXmlEnvironment)
@Deprecated public Message clone()
asBuilder() instead.This does not perform a deep clone, as extension elements are shared between the new and old instance.
clone in class java.lang.Object