|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.echomine.jabber.JabberMessage
com.echomine.jabber.JabberJDOMMessage
public class JabberJDOMMessage
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.
Field Summary |
---|
Fields inherited from class com.echomine.jabber.JabberMessage |
---|
messageID |
Constructor Summary | |
---|---|
protected |
JabberJDOMMessage()
|
|
JabberJDOMMessage(Element rootElem)
normally used internally or creating outgoing messages. |
Method Summary | |
---|---|
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()
|
Methods inherited from class com.echomine.jabber.JabberMessage |
---|
getMessageID, getReplyMessage, getTimeout, getXMessage, getXMessages, interrupt, isReplyRequired, isSendXMessages, isSynchronized, replyReceived, 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 |
---|
protected JabberJDOMMessage()
public JabberJDOMMessage(Element rootElem)
Method Detail |
---|
public JabberMessage parse(JabberMessageParser parser, Element msgTree) throws ParseException
JabberMessageParsable
parse
in interface JabberMessageParsable
ParseException
public void setMessageID(java.lang.String messageID)
setMessageID
in class JabberMessage
public Element getDOM()
public java.lang.String encode() throws ParseException
encode
in class JabberMessage
ParseException
- if something went wrong during encodingpublic java.lang.String toString()
toString
in class java.lang.Object
protected XMLOutputter getXMLOutputter()
public int getMessageType()
getMessageType
in class JabberMessage
JabberCode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |