I’'m creating message handler for the IQ packet. There does not seem to be a method on the IQ class that returns whether the IQ packet is a Registration packet, an Authentication packet, a Roster packet, or some other IQ packet.
I could use “instanceof” to test what kind of subclass the IQ packet is, but that’'s kind of ugly.
There is a getQueryXML() method which returns the XML containing the info I need to determine the type of packet, but I would have to parse it manually.
Does anybody know of a good way of determining the type of IQ packet?