public class JabberJDOMMessage extends JabberMessage implements JabberMessageParsable
The default message type that essentially contains all the data in a JDOM tree. Subclasses can actually extend from this class to parse the tree and store the data in more easily access form. They can also provide getXXX methods to retrieve the data. JDOM is provided as part of the distribution.
If you do not want to create a new message class that extends from this class, you can retrieve the internal JDOM tree and then manipulate it manually. It is suggested that you create a new message class to handle and process the information so you can reuse it in the future. Then you can also contribute the message class back to the project. :)
By default, JDOM Messages adds the X Namespaces. Thus, they are automatically inserted into the DOM tree and sent along with the message. If you do not want the X Messages to be sent, you can use the setSendXMessage() method to disable it.
messageID| Modifier | Constructor and Description |
|---|---|
protected |
JabberJDOMMessage() |
|
JabberJDOMMessage(Element rootElem)
normally used internally or creating outgoing messages.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
encode()
The default encoding will serialize the DOM Tree.
|
Element |
getDOM()
retrieves the DOM tree related to the message..
|
int |
getMessageType()
the default message type is unknown.
|
protected XMLOutputter |
getXMLOutputter()
retrieves the XML Outputter associated with every jabber jdom message.
|
JabberMessage |
parse(JabberMessageParser parser,
Element msgTree)
parse element/incoming message into a message object.
|
void |
setMessageID(java.lang.String messageID)
sets the message id.
|
java.lang.String |
toString() |
getMessageID, getReplyMessage, getTimeout, getXMessage, getXMessages, interrupt, isReplyRequired, isSendXMessages, isSynchronized, replyReceived, setReplyRequired, setSendXMessages, setSynchronized, setTimeout, setXMessage, setXMessagesprotected JabberJDOMMessage()
public JabberJDOMMessage(Element rootElem)
public JabberMessage parse(JabberMessageParser parser, Element msgTree) throws ParseException
JabberMessageParsableparse in interface JabberMessageParsableParseExceptionpublic void setMessageID(java.lang.String messageID)
setMessageID in class JabberMessagepublic Element getDOM()
public java.lang.String encode()
throws ParseException
encode in class JabberMessageParseException - if something went wrong during encodingpublic java.lang.String toString()
toString in class java.lang.Objectprotected XMLOutputter getXMLOutputter()
public int getMessageType()
getMessageType in class JabberMessageJabberCodeCopyright © 2001-2005 Echomine. All Rights Reserved.