CryptoMessage v1.3.2版本的 MD5 值为:66c611ce56a11450659dc23697562928
以下内容为反编译后的 HeadersExtension.java 源代码,内容仅作参考
package org.jivesoftware.smackx.shim.packet;
import java.util.Collections;
import java.util.List;
import javax.xml.namespace.QName;
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.util.XmlStringBuilder;
public class HeadersExtension implements ExtensionElement {
private final List<Header> headers;
public static final String NAMESPACE = "http://jabber.org/protocol/shim";
public static final String ELEMENT = "headers";
public static final QName QNAME = new QName(NAMESPACE, ELEMENT);
@Override
public String getElementName() {
return ELEMENT;
}
@Override
public String getNamespace() {
return NAMESPACE;
}
public HeadersExtension(List<Header> list) {
if (list != null) {
this.headers = Collections.unmodifiableList(list);
} else {
this.headers = Collections.emptyList();
}
}
public List<Header> getHeaders() {
return this.headers;
}
@Override
public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) {
XmlStringBuilder xmlStringBuilder = new XmlStringBuilder((FullyQualifiedElement) this);
xmlStringBuilder.rightAngleBracket();
xmlStringBuilder.append(this.headers);
xmlStringBuilder.closeElement(this);
return xmlStringBuilder;
}
public static HeadersExtension from(Stanza stanza) {
return (HeadersExtension) stanza.getExtension(HeadersExtension.class);
}
}