org.jabber.jabberbeans
Class Message

java.lang.Object
  |
  +--org.jabber.jabberbeans.XMLData
        |
        +--org.jabber.jabberbeans.ContentPacket
              |
              +--org.jabber.jabberbeans.Message

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>

Version:
$Revision: 1.1.1.1 $
Author:
David Waite <dwaite@jabber.com>, $Author: lucky $
See Also:
Serialized Form

Field Summary
private  java.lang.String body
          Body string
private  java.lang.String subject
          Subject string
private  java.lang.String thread
          Thread string
 
Fields inherited from class org.jabber.jabberbeans.ContentPacket
errorCode, errorText, 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, 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, registerNatives, wait, wait, wait
 

Field Detail

subject

private java.lang.String subject
Subject string

thread

private java.lang.String thread
Thread string

body

private java.lang.String body
Body string
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.
Overrides:
appendItem in class XMLData
Parameters:
retval - The StringBuffer to append to