org.media.mn8.protocol.jabber.datablocks
Class Message

java.lang.Object
  |
  +--org.media.mn8.protocol.jabber.JabberDataBlock
        |
        +--org.media.mn8.protocol.jabber.datablocks.Message

public class Message
extends JabberDataBlock

The class representing a Jabber message object


Field Summary
 
Fields inherited from class org.media.mn8.protocol.jabber.JabberDataBlock
attributes, childBlocks, parent, textData
 
Constructor Summary
Message()
          Default Constructor.
Message(JabberDataBlock _parent, Hashtable _attributes)
          Constructor for incomming messages
Message(String to)
          Constructor.
Message(String to, String message)
          Constructor.
 
Method Summary
 Message constructReply()
          Construct a reply message
 String getBody()
          Method to get the message body
 String getSubject()
          Method to get the message subject
 String getTagName()
          Get the tag start marker
 void setBodyText(String text)
          Method to set the body text.
 void setHTMLBodyText(String html)
          Method to set the body text written in HTML.
 void setSubject(String text)
          Method to set the subject text.
 void setThread(String text)
          Method to set the message thread.
 
Methods inherited from class org.media.mn8.protocol.jabber.JabberDataBlock
addAttributeToStringBuffer, addChild, addText, constructReply, getAttribute, getBytes, getChildBlocks, getParent, getTagEnd, getTagStart, getText, setAttribute, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Message

public Message(String to,
               String message)
Constructor. Prepares the message destination and body

Parameters:
to - The destination of the message
message - The message text

Message

public Message(String to)
Constructor. Prepares the message destination

Parameters:
to - The destination of the message

Message

public Message()
Default Constructor. Alls for construction of an empty message template.


Message

public Message(JabberDataBlock _parent,
               Hashtable _attributes)
Constructor for incomming messages

Parameters:
_parent - The parent of this datablock
_attributes - The list of element attributes
Method Detail

setBodyText

public void setBodyText(String text)
Method to set the body text. Creates a block with body as it's tag name and inserts the text into it.


setHTMLBodyText

public void setHTMLBodyText(String html)
Method to set the body text written in HTML. Creates a block with html as it's tag name in the xhtml name space and inserts the html into it.

Parameters:
html - The html to go in the message body

setThread

public void setThread(String text)
Method to set the message thread. Creates a block with thread as it's tag name and inserts the thread name into it.


setSubject

public void setSubject(String text)
Method to set the subject text. Creates a subject block and inserts the text into it.

Parameters:
text - The string to go in the message subject

getSubject

public String getSubject()
Method to get the message subject

Returns:
A string representing the message subject

getBody

public String getBody()
Method to get the message body

Returns:
The message body as a string

constructReply

public Message constructReply()
Construct a reply message

Returns:
A message object destined for the sender of this message with no subject or body

getTagName

public String getTagName()
Get the tag start marker

Overrides:
getTagName in class JabberDataBlock
Returns:
The block start tag


"Copyright © 2000-2002 Internet Multicasting Services, media.org & noLimits Technologies. All Rights Reserved."