正在查看: bbinstant v6.24.0 应用的 XHTMLExtension.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: bbinstant v6.24.0 应用的 XHTMLExtension.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package org.jivesoftware.smackx.xhtmlim.packet;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.jivesoftware.smack.packet.ExtensionElement;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.util.XmlStringBuilder;
public class XHTMLExtension implements ExtensionElement {
public static final String ELEMENT = "html";
public static final String NAMESPACE = "http://jabber.org/protocol/xhtml-im";
private final List<CharSequence> bodies = new ArrayList();
public static XHTMLExtension from(Message message) {
return (XHTMLExtension) message.getExtension(ELEMENT, NAMESPACE);
}
public void addBody(CharSequence charSequence) {
synchronized (this.bodies) {
this.bodies.add(charSequence);
}
}
public List<CharSequence> getBodies() {
List<CharSequence> unmodifiableList;
synchronized (this.bodies) {
unmodifiableList = Collections.unmodifiableList(new ArrayList(this.bodies));
}
return unmodifiableList;
}
public int getBodiesCount() {
int size;
synchronized (this.bodies) {
size = this.bodies.size();
}
return size;
}
@Override
public String getElementName() {
return ELEMENT;
}
@Override
public String getNamespace() {
return NAMESPACE;
}
@Override
public XmlStringBuilder toXML() {
XmlStringBuilder xmlStringBuilder = new XmlStringBuilder((ExtensionElement) this);
xmlStringBuilder.rightAngleBracket();
Iterator<CharSequence> it = getBodies().iterator();
while (it.hasNext()) {
xmlStringBuilder.append(it.next());
}
xmlStringBuilder.closeElement(this);
return xmlStringBuilder;
}
}