CryptoMessage v1.3.2版本的 MD5 值为:66c611ce56a11450659dc23697562928
以下内容为反编译后的 DataLayout.java 源代码,内容仅作参考
package org.jivesoftware.smackx.xdatalayout.packet;
import java.util.ArrayList;
import java.util.List;
import org.jivesoftware.smack.packet.ExtensionElement;
import org.jivesoftware.smack.packet.FullyQualifiedElement;
import org.jivesoftware.smack.packet.XmlEnvironment;
import org.jivesoftware.smack.util.XmlStringBuilder;
public class DataLayout implements ExtensionElement {
public static final String ELEMENT = "page";
public static final String NAMESPACE = "http://jabber.org/protocol/xdata-layout";
private final String label;
private final List<DataFormLayoutElement> pageLayout = new ArrayList();
public static abstract class DataFormLayoutElement implements ExtensionElement {
@Override
public final String getNamespace() {
return DataLayout.NAMESPACE;
}
}
@Override
public String getElementName() {
return ELEMENT;
}
@Override
public String getNamespace() {
return NAMESPACE;
}
public DataLayout(String str) {
this.label = str;
}
public List<DataFormLayoutElement> getPageLayout() {
return this.pageLayout;
}
public String getLabel() {
return this.label;
}
@Override
public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) {
XmlStringBuilder xmlStringBuilder = new XmlStringBuilder((FullyQualifiedElement) this);
xmlStringBuilder.optAttribute("label", getLabel());
xmlStringBuilder.rightAngleBracket();
xmlStringBuilder.append(getPageLayout());
xmlStringBuilder.closeElement(this);
return xmlStringBuilder;
}
public static class Fieldref extends DataFormLayoutElement {
public static final String ELEMENT = "fieldref";
private final String var;
@Override
public String getElementName() {
return ELEMENT;
}
public Fieldref(String str) {
this.var = str;
}
@Override
public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) {
XmlStringBuilder xmlStringBuilder = new XmlStringBuilder(this, xmlEnvironment);
xmlStringBuilder.attribute("var", getVar());
xmlStringBuilder.closeEmptyElement();
return xmlStringBuilder;
}
public String getVar() {
return this.var;
}
}
public static class Section extends DataFormLayoutElement {
public static final String ELEMENT = "section";
private final String label;
private final List<DataFormLayoutElement> sectionLayout = new ArrayList();
@Override
public String getElementName() {
return ELEMENT;
}
public Section(String str) {
this.label = str;
}
public List<DataFormLayoutElement> getSectionLayout() {
return this.sectionLayout;
}
@Override
public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) {
XmlStringBuilder xmlStringBuilder = new XmlStringBuilder(this, xmlEnvironment);
xmlStringBuilder.optAttribute("label", getLabel());
xmlStringBuilder.rightAngleBracket();
xmlStringBuilder.append(getSectionLayout());
xmlStringBuilder.closeElement(ELEMENT);
return xmlStringBuilder;
}
public String getLabel() {
return this.label;
}
}
public static class Reportedref extends DataFormLayoutElement {
public static final String ELEMENT = "reportedref";
@Override
public String getElementName() {
return ELEMENT;
}
@Override
public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) {
XmlStringBuilder xmlStringBuilder = new XmlStringBuilder(this, xmlEnvironment);
xmlStringBuilder.closeEmptyElement();
return xmlStringBuilder;
}
}
public static class Text extends DataFormLayoutElement {
public static final String ELEMENT = "text";
private final String text;
@Override
public String getElementName() {
return "text";
}
public Text(String str) {
this.text = str;
}
@Override
public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) {
XmlStringBuilder xmlStringBuilder = new XmlStringBuilder(this, xmlEnvironment);
xmlStringBuilder.rightAngleBracket();
xmlStringBuilder.escape(getText());
xmlStringBuilder.closeElement(this);
return xmlStringBuilder;
}
public String getText() {
return this.text;
}
}
}