com.echomine.jabber
Class JabberIQMessageParser
java.lang.Object
com.echomine.jabber.JabberIQMessageParser
- All Implemented Interfaces:
- JabberMessageParsable
public class JabberIQMessageParser
- extends java.lang.Object
- implements JabberMessageParsable
Since IQ Messages are unique based on the internal tag, special parser classes is created just to create the
appropriate IQ message. This parser will check to see which iq message it is. It will simply pass the delegation
of creating the message back to the JabberMessageParser. In essence, it's sorta doing a double roundabout loop
just to create the message. This way, all message parsers need only be registered with one object.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JabberIQMessageParser
public JabberIQMessageParser()
parse
public JabberMessage parse(JabberMessageParser parser,
Element msgTree)
throws ParseException
- Description copied from interface:
JabberMessageParsable
- parse element/incoming message into a message object. Note that the parsing is unique in that
during normal behavior, you will return "this" at the end of the method. However, for those
message that require "morphing" into another message type (ie. IQ Messages), the method can
return a new instance of another JabberMessage to replace the current one.
- Specified by:
parse
in interface JabberMessageParsable
- Returns:
- the JabberMessage or null if the type is not recognized
- Throws:
ParseException
Copyright © 2001-2005 Echomine. All Rights Reserved.