org.jabber.jabberbeans
Class Message

java.lang.Object
  |
  +--org.jabber.jabberbeans.XMLData
        |
        +--org.jabber.jabberbeans.ContentPacket
              |
              +--org.jabber.jabberbeans.Message
All Implemented Interfaces:
Extension, Packet, java.io.Serializable

public final class Message
extends ContentPacket
implements java.io.Serializable

This is the data type that holds the data of a message. from the jabber documentation page here we get the message format (sorry, not in DTD format):

<message to="*" from="*" id="*" type="error|normal|chat|groupchat">

The following metadata
<subject>subject text</subject>
<thread>thread id</thread>

and the following content types:

<body>main text of message</body>

<ext xmlns="jabber:x:*"></ext>

</message>

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jabber.jabberbeans.ContentPacket
error, extensions, fromAddress, identifier, toAddress, type
 
Constructor Summary
Message(MessageBuilder builder)
          Builds a message, based on the data in the MessageBuilder.
 
Method Summary
 void appendItem(java.lang.StringBuffer retval)
          appendItem appends the XML representation of the current packet data to the specified StringBuffer.
 java.lang.String getBody()
          getBody returns the text within the body element, if any
 java.lang.String getSubject()
          getSubject returns the text within the subject element, if any
 java.lang.String getThread()
          getThread returns the text within the thread element, if any
 
Methods inherited from class org.jabber.jabberbeans.ContentPacket
appendAnyError, appendBaseAttribs, Extensions, getError, getErrorCode, getErrorText, getFromAddress, getIdentifier, getToAddress, getType
 
Methods inherited from class org.jabber.jabberbeans.XMLData
appendAttrib, appendAttrib, appendChild, appendChild, escapeString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jabber.jabberbeans.Packet
toString
 
Methods inherited from interface org.jabber.jabberbeans.Extension.Extension
toString
 

Constructor Detail

Message

public Message(MessageBuilder builder)
        throws java.lang.InstantiationException
Builds a message, based on the data in the MessageBuilder.

Parameters:
builder - 'MessageBuilder' to feed in.
Throws:
java.lang.InstantiationException - thrown if not enough/malformed data was in the MessageBuilder
Method Detail

getSubject

public final java.lang.String getSubject()
getSubject returns the text within the subject element, if any

Returns:
a String value, or null if no subject

getThread

public final java.lang.String getThread()
getThread returns the text within the thread element, if any

Returns:
a String value, or null if no thread

getBody

public final java.lang.String getBody()
getBody returns the text within the body element, if any

Returns:
a String value, or null if no body

appendItem

public final void appendItem(java.lang.StringBuffer retval)
appendItem appends the XML representation of the current packet data to the specified StringBuffer.

Specified by:
appendItem in interface Packet
Specified by:
appendItem in class XMLData
Parameters:
retval - The StringBuffer to append to