CryptoMessage v1.3.2版本的 MD5 值为:66c611ce56a11450659dc23697562928
以下内容为反编译后的 InviteUserExtension.java 源代码,内容仅作参考
package org.jivesoftware.smackx.muc;
import java.io.IOException;
import javax.xml.namespace.QName;
import org.jivesoftware.smack.db.entities.MultiUserChatItem;
import org.jivesoftware.smack.packet.ExtensionElement;
import org.jivesoftware.smack.packet.FullyQualifiedElement;
import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.packet.XmlEnvironment;
import org.jivesoftware.smack.parsing.SmackParsingException;
import org.jivesoftware.smack.provider.ExtensionElementProvider;
import org.jivesoftware.smack.util.XmlStringBuilder;
import org.jivesoftware.smack.xml.XmlPullParser;
import org.jivesoftware.smack.xml.XmlPullParserException;
public class InviteUserExtension implements ExtensionElement {
public static final String ELEMENT = "x";
public static final String NAMESPACE = "http://jabber.org/protocol/muc#invite_user";
public static final QName QNAME = new QName(NAMESPACE, "x");
private String item;
private String room;
@Override
public String getElementName() {
return "x";
}
@Override
public String getNamespace() {
return NAMESPACE;
}
public InviteUserExtension(String str, String str2) {
this.item = str2;
this.room = str;
}
public InviteUserExtension() {
}
public static InviteUserExtension from(Stanza stanza) {
return (InviteUserExtension) stanza.getExtension(InviteUserExtension.class);
}
@Override
public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) {
XmlStringBuilder xmlStringBuilder = new XmlStringBuilder((FullyQualifiedElement) this);
xmlStringBuilder.attribute("item", getItem());
xmlStringBuilder.attribute(MultiUserChatItem.ROOM, getRoom());
xmlStringBuilder.closeEmptyElement();
return xmlStringBuilder;
}
public String getItem() {
return this.item;
}
public void setItem(String str) {
this.item = str;
}
public String getRoom() {
return this.room;
}
public void setRoom(String str) {
this.room = str;
}
public static class Provider extends ExtensionElementProvider<InviteUserExtension> {
@Override
public InviteUserExtension parse(XmlPullParser xmlPullParser, int i, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException, SmackParsingException {
InviteUserExtension inviteUserExtension = new InviteUserExtension();
while (true) {
int i2 = AnonymousClass1.$SwitchMap$org$jivesoftware$smack$xml$XmlPullParser$Event[xmlPullParser.next().ordinal()];
if (i2 == 1) {
String name = xmlPullParser.getName();
name.hashCode();
if (name.equals("item")) {
inviteUserExtension.setItem(xmlPullParser.nextText());
} else if (name.equals(MultiUserChatItem.ROOM)) {
inviteUserExtension.setRoom(xmlPullParser.nextText());
}
} else if (i2 == 2 && xmlPullParser.getDepth() == i) {
return inviteUserExtension;
}
}
}
}
public static class AnonymousClass1 {
static final int[] $SwitchMap$org$jivesoftware$smack$xml$XmlPullParser$Event;
static {
int[] iArr = new int[XmlPullParser.Event.values().length];
$SwitchMap$org$jivesoftware$smack$xml$XmlPullParser$Event = iArr;
try {
iArr[XmlPullParser.Event.START_ELEMENT.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$org$jivesoftware$smack$xml$XmlPullParser$Event[XmlPullParser.Event.END_ELEMENT.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
}
}
}