Package org.jivesoftware.smack.packet
Class Message
java.lang.Object
org.jivesoftware.smack.packet.Stanza
org.jivesoftware.smack.packet.MessageOrPresence<MessageBuilder>
org.jivesoftware.smack.packet.Message
- All Implemented Interfaces:
Element
,MessageView
,NamedElement
,StanzaView
,TopLevelStreamElement
,XmlElement
,XmlLangElement
Represents XMPP message packets. A message can be one of several types:
- Message.Type.NORMAL -- (Default) a normal text message used in email like interface.
- Message.Type.CHAT -- a typically short text message used in line-by-line chat interfaces.
- Message.Type.GROUP_CHAT -- a chat message sent to a groupchat server for group chats.
- Message.Type.HEADLINE -- a text message to be displayed in scrolling marquee displays.
- Message.Type.ERROR -- indicates a messaging error.
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 |
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Represents a message body, its language and the content of the message.static final class
Represents a message subject, its language and the content of the subject.static class
static enum
Represents the type of a message. -
Field Summary
FieldsFields inherited from class org.jivesoftware.smack.packet.Stanza
DEFAULT_LANGUAGE, ITEM, language, TEXT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasBuilder
(XMPPConnection connection) Returns the root element name.getType()
Returns the type of the message.toString()
Returns a short String describing the Stanza.toXML
(XmlEnvironment enclosingXmlEnvironment) Methods inherited from class org.jivesoftware.smack.packet.Stanza
addCommonAttributes, addExtension, addExtensions, appendErrorIfExists, getDefaultLanguage, getError, getExtension, getExtension, getExtensionElement, getExtensions, getExtensions, getExtensions, getExtensions, getExtensionsMap, getFrom, getLanguage, getNamespace, getStanzaId, getTo, hasExtension, hasExtension, hasStanzaIdSet, logCommonAttributes, overrideExtension, removeExtension, setError, setFrom, setNewStanzaId, setStanzaId, setTo, throwIfNoStanzaId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jivesoftware.smack.packet.MessageView
getBodies, getBody, getBody, getBodyLanguages, getMessageBody, getMessageSubject, getSubject, getSubject, getSubjectLanguages, getSubjects, getThread
Methods inherited from interface org.jivesoftware.smack.packet.StanzaView
getError, getExtension, getExtension, getExtensions, getExtensions, getExtensions, getFrom, getStanzaId, getTo, hasExtension, hasExtension, hasExtension
Methods inherited from interface org.jivesoftware.smack.packet.XmlElement
getQName
-
Field Details
-
ELEMENT
- See Also:
-
BODY
- See Also:
-
-
Constructor Details
-
Message
Copy constructor.This does not perform a deep clone, as extension elements are shared between the new and old instance.
- Parameters:
other
- TODO javadoc me please
-
-
Method Details
-
getType
Description copied from interface:MessageView
Returns the type of the message. If no type has been set this method will returnMessage.Type.normal
.- Specified by:
getType
in interfaceMessageView
- Returns:
- the type of the message.
-
getElementName
Description copied from interface:NamedElement
Returns the root element name.- Specified by:
getElementName
in interfaceNamedElement
- Returns:
- the element name.
-
asBuilder
- Specified by:
asBuilder
in classMessageOrPresence<MessageBuilder>
-
asBuilder
- Specified by:
asBuilder
in classMessageOrPresence<MessageBuilder>
-
asBuilder
- Specified by:
asBuilder
in classMessageOrPresence<MessageBuilder>
-
toString
Description copied from class:Stanza
Returns a short String describing the Stanza. This method is suited for log purposes. -
toXML
-