com.echomine.jabber
Class JabberStringMessage

java.lang.Object
  extended by com.echomine.jabber.JabberMessage
      extended by com.echomine.jabber.JabberStringMessage

public class JabberStringMessage
extends JabberMessage

Base message type that uses a string to store the message. The message does not get parsed into XML DOM tree. It simply just sends the string as is. This is useful for debugging and for simple messages to send. This message is usually used for outgoing message purpose.

By default, the String messages will NOT support X Messages and encode them for outputting purposes because the string is as-is.


Field Summary
 
Fields inherited from class com.echomine.jabber.JabberMessage
messageID
 
Constructor Summary
JabberStringMessage(int msgType)
           
JabberStringMessage(int msgType, java.lang.String msgText)
           
 
Method Summary
 java.lang.String encode()
          encodes the data into an XML string that is ready to be sent out to the network.
 java.lang.String getMessage()
           
 int getMessageType()
          This method will indicate what type of message it is.
 void setMessage(java.lang.String msgText)
          sets the message to the passed in XML text.
 void setMessageType(int msgType)
           
 java.lang.String toString()
           
 
Methods inherited from class com.echomine.jabber.JabberMessage
getMessageID, getReplyMessage, getTimeout, getXMessage, getXMessages, interrupt, isReplyRequired, isSendXMessages, isSynchronized, replyReceived, setMessageID, setReplyRequired, setSendXMessages, setSynchronized, setTimeout, setXMessage, setXMessages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JabberStringMessage

public JabberStringMessage(int msgType)

JabberStringMessage

public JabberStringMessage(int msgType,
                           java.lang.String msgText)
Method Detail

setMessage

public void setMessage(java.lang.String msgText)
sets the message to the passed in XML text.


getMessage

public java.lang.String getMessage()
Returns:
the message contained by this object

encode

public java.lang.String encode()
Description copied from class: JabberMessage
encodes the data into an XML string that is ready to be sent out to the network. This method is only used for outgoing messages.

Specified by:
encode in class JabberMessage

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setMessageType

public void setMessageType(int msgType)

getMessageType

public int getMessageType()
Description copied from class: JabberMessage
This method will indicate what type of message it is. Currently, the unique way to identify a message is through an arbitrarily assigned int that's listed in JabberCode. By comparing the message type, you can then filter out the exact type of message you're looking for.

Specified by:
getMessageType in class JabberMessage
Returns:
a message code that is unique to the message
See Also:
JabberCode


Copyright © 2001-2005 Echomine. All Rights Reserved.