public class JDOMMessageHandler extends JabberMessageHandler
The JDOM MessageHandler is the default handler for all incoming messages. It simply takes all incoming messages and put them into a JDOM tree structure that can later be queried and manipulated. JDOM is provided as part of the distribution.
Normally, this will be the base class for all other message handlers. "Subhandlers" normally work directly with the DOM tree and don't have to worry about SAX events. If you're not interested in using JDOM as the base handler, you can create your own MessageHandler and handle the messages your own way.
| Constructor and Description |
|---|
JDOMMessageHandler(JabberMessageParser msgParser) |
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] ch,
int start,
int length)
the methods that must be implemented to work with the XML content that's coming in
|
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
the methods that must be implemented to work with the XML content that's coming in
|
void |
endMessage()
This method is called when the end of the message is reached.
|
Element |
getDOM()
obtains the DOM tree that is associated with this message handler.
|
JabberMessage |
getMessage()
the method actually has the parser parse the message.
|
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attr)
the methods that must be implemented to work with the XML content that's coming in
|
void |
startMessage()
This method is called when the beginning of the message is received.
|
getMessageParserpublic JDOMMessageHandler(JabberMessageParser msgParser)
public void startMessage()
startMessage in class JabberMessageHandlerpublic void endMessage()
endMessage in class JabberMessageHandlerpublic void startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attr)
JabberMessageHandlerstartElement in class JabberMessageHandlerpublic void endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
JabberMessageHandlerendElement in class JabberMessageHandlerpublic void characters(char[] ch,
int start,
int length)
JabberMessageHandlercharacters in class JabberMessageHandlerpublic Element getDOM()
public JabberMessage getMessage()
getMessage in class JabberMessageHandlerCopyright © 2001-2005 Echomine. All Rights Reserved.