CryptoMessage v1.3.2版本的 MD5 值为:66c611ce56a11450659dc23697562928
以下内容为反编译后的 SharedGroupsInfo.java 源代码,内容仅作参考
package org.jivesoftware.smackx.sharedgroups.packet;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.XmlEnvironment;
import org.jivesoftware.smack.provider.IQProvider;
import org.jivesoftware.smack.roster.packet.RosterPacket;
import org.jivesoftware.smack.xml.XmlPullParser;
import org.jivesoftware.smack.xml.XmlPullParserException;
public class SharedGroupsInfo extends IQ {
public static final String ELEMENT = "sharedgroup";
public static final String NAMESPACE = "http://www.jivesoftware.org/protocol/sharedgroup";
private final List<String> groups;
public SharedGroupsInfo() {
super(ELEMENT, NAMESPACE);
this.groups = new ArrayList();
}
public List<String> getGroups() {
return this.groups;
}
@Override
protected IQ.IQChildElementXmlStringBuilder getIQChildElementBuilder(IQ.IQChildElementXmlStringBuilder iQChildElementXmlStringBuilder) {
iQChildElementXmlStringBuilder.rightAngleBracket();
Iterator<String> it = this.groups.iterator();
while (it.hasNext()) {
iQChildElementXmlStringBuilder.element(RosterPacket.Item.GROUP, it.next());
}
return iQChildElementXmlStringBuilder;
}
public static class Provider extends IQProvider<SharedGroupsInfo> {
@Override
public SharedGroupsInfo parse(XmlPullParser xmlPullParser, int i, XmlEnvironment xmlEnvironment) throws XmlPullParserException, IOException {
SharedGroupsInfo sharedGroupsInfo = new SharedGroupsInfo();
boolean z = false;
while (!z) {
XmlPullParser.Event next = xmlPullParser.next();
if (next == XmlPullParser.Event.START_ELEMENT && xmlPullParser.getName().equals(RosterPacket.Item.GROUP)) {
sharedGroupsInfo.getGroups().add(xmlPullParser.nextText());
} else if (next == XmlPullParser.Event.END_ELEMENT && xmlPullParser.getName().equals(SharedGroupsInfo.ELEMENT)) {
z = true;
}
}
return sharedGroupsInfo;
}
}
}