导航菜单

页面标题

页面副标题

Housing v14.7.8 - Compress.java 源代码

正在查看: Housing v14.7.8 应用的 Compress.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package org.jivesoftware.smack.compress.packet;

import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.jivesoftware.smack.packet.ExtensionElement;
import org.jivesoftware.smack.packet.FullStreamElement;
import org.jivesoftware.smack.util.XmlStringBuilder;

public class Compress extends FullStreamElement {
    public static final String ELEMENT = "compress";
    public static final String NAMESPACE = "http://jabber.org/protocol/compress";
    public final String method;

    public static class Feature implements ExtensionElement {
        public static final String ELEMENT = "compression";
        public final List<String> methods;

        public Feature(List<String> list) {
            this.methods = list;
        }

        @Override
        public String getElementName() {
            return ELEMENT;
        }

        public List<String> getMethods() {
            return Collections.unmodifiableList(this.methods);
        }

        @Override
        public String getNamespace() {
            return "http://jabber.org/protocol/compress";
        }

        @Override
        public XmlStringBuilder toXML() {
            XmlStringBuilder xmlStringBuilder = new XmlStringBuilder((ExtensionElement) this);
            xmlStringBuilder.rightAngleBracket();
            Iterator<String> it = this.methods.iterator();
            while (it.hasNext()) {
                xmlStringBuilder.element("method", it.next());
            }
            xmlStringBuilder.closeElement(this);
            return xmlStringBuilder;
        }
    }

    public Compress(String str) {
        this.method = str;
    }

    @Override
    public String getElementName() {
        return ELEMENT;
    }

    @Override
    public String getNamespace() {
        return "http://jabber.org/protocol/compress";
    }

    @Override
    public XmlStringBuilder toXML() {
        XmlStringBuilder xmlStringBuilder = new XmlStringBuilder((ExtensionElement) this);
        xmlStringBuilder.rightAngleBracket();
        xmlStringBuilder.element("method", this.method);
        xmlStringBuilder.closeElement(this);
        return xmlStringBuilder;
    }
}