|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.realtime.xmpp.dom.DomPacketInterpreter
Helper class to interpret a DOM XMPP packet. Provides static methods for quick evaluations of documents.
Constructor Summary | |
DomPacketInterpreter()
|
Method Summary | |
static org.dom4j.Element |
getError(org.dom4j.Element packet)
Provide the element containing the error code and description. |
static int |
getErrorCode(org.dom4j.Element packet)
Inspect the packet and look for children named error. |
static java.lang.String |
getFrom(org.dom4j.Element packet)
Provide the 'from' field. |
static java.lang.String |
getId(org.dom4j.Element packet)
Provide the 'id' field. |
static java.lang.String |
getTo(org.dom4j.Element packet)
Provide the 'to' field. |
static java.lang.String |
getType(org.dom4j.Element packet)
Provide the type of the iq packet (get,set, result, or error). |
static boolean |
hasError(org.dom4j.Element packet)
Inspect the packet and look for children named error. |
static boolean |
isInfoQuery(org.dom4j.Element packet)
Test if this packet is an InfoQuery. |
static boolean |
isMessage(org.dom4j.Element packet)
Test if this packet is a message. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DomPacketInterpreter()
Method Detail |
public static java.lang.String getTo(org.dom4j.Element packet)
Provide the 'to' field.
public static java.lang.String getFrom(org.dom4j.Element packet)
Provide the 'from' field.
public static java.lang.String getId(org.dom4j.Element packet)
Provide the 'id' field.
public static boolean isMessage(org.dom4j.Element packet)
packet
- The packet to test.
public static boolean isInfoQuery(org.dom4j.Element packet)
packet
- The packet to test.
public static java.lang.String getType(org.dom4j.Element packet)
Provide the type of the iq packet (get,set, result, or error).
* @param packet * @return boolean
public static boolean hasError(org.dom4j.Element packet)
Inspect the packet and look for children named error. If any are found, then return true.
packet
- The XMPP packet to inspect.
* @return True if any of the packets first level child elements
are named error.public static int getErrorCode(org.dom4j.Element packet)
Inspect the packet and look for children named error. If any are found, then return the error code.
packet
- The XMPP packet to inspect.
public static org.dom4j.Element getError(org.dom4j.Element packet)
Provide the element containing the error code and description.
packet
- The XMPP packet to inspect.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |