Java 类org.jivesoftware.smackx.muc.packet.Destroy 实例源码

项目:Smack    文件:MUCParserUtils.java   
public static Destroy parseDestroy(XmlPullParser parser) throws XmlPullParserException, IOException {
    boolean done = false;
    Destroy destroy = new Destroy();
    destroy.setJid(parser.getAttributeValue("", "jid"));
    while (!done) {
        int eventType = parser.next();
        if (eventType == XmlPullParser.START_TAG) {
            if (parser.getName().equals("reason")) {
                destroy.setReason(parser.nextText());
            }
        }
        else if (eventType == XmlPullParser.END_TAG) {
            if (parser.getName().equals("destroy")) {
                done = true;
            }
        }
    }
    return destroy;
}