Search in sources :

Example 41 with XmlStringBuilder

use of org.jivesoftware.smack.util.XmlStringBuilder in project Smack by igniterealtime.

the class FormField method toXML.

@Override
public XmlStringBuilder toXML() {
    XmlStringBuilder buf = new XmlStringBuilder(this);
    // Add attributes
    buf.optAttribute("label", getLabel());
    buf.optAttribute("var", getVariable());
    buf.optAttribute("type", getType());
    buf.rightAngleBracket();
    // Add elements
    buf.optElement("desc", getDescription());
    buf.condEmptyElement(isRequired(), "required");
    // Loop through all the values and append them to the string buffer
    for (String value : getValues()) {
        buf.element("value", value);
    }
    // Loop through all the values and append them to the string buffer
    for (Option option : getOptions()) {
        buf.append(option.toXML());
    }
    buf.optElement(validateElement);
    buf.closeElement(this);
    return buf;
}
Also used : XmlStringBuilder(org.jivesoftware.smack.util.XmlStringBuilder)

Example 42 with XmlStringBuilder

use of org.jivesoftware.smack.util.XmlStringBuilder in project Smack by igniterealtime.

the class Affiliation method toXML.

@Override
public XmlStringBuilder toXML() {
    XmlStringBuilder xml = new XmlStringBuilder(this);
    xml.optAttribute("node", node);
    xml.optAttribute("jid", jid);
    xml.optAttribute("affiliation", affiliation);
    xml.closeEmptyElement();
    return xml;
}
Also used : XmlStringBuilder(org.jivesoftware.smack.util.XmlStringBuilder)

Example 43 with XmlStringBuilder

use of org.jivesoftware.smack.util.XmlStringBuilder in project Smack by igniterealtime.

the class EventElement method toXML.

@Override
public XmlStringBuilder toXML() {
    XmlStringBuilder xml = new XmlStringBuilder(this);
    xml.rightAngleBracket();
    xml.append(ext.toXML());
    xml.closeElement(this);
    return xml;
}
Also used : XmlStringBuilder(org.jivesoftware.smack.util.XmlStringBuilder)

Example 44 with XmlStringBuilder

use of org.jivesoftware.smack.util.XmlStringBuilder in project Smack by igniterealtime.

the class SubscriptionPreApproval method toXML.

@Override
public XmlStringBuilder toXML() {
    XmlStringBuilder xml = new XmlStringBuilder(this);
    xml.closeEmptyElement();
    return xml;
}
Also used : XmlStringBuilder(org.jivesoftware.smack.util.XmlStringBuilder)

Example 45 with XmlStringBuilder

use of org.jivesoftware.smack.util.XmlStringBuilder in project Smack by igniterealtime.

the class RoomTransfer method toXML.

@Override
public XmlStringBuilder toXML() {
    XmlStringBuilder xml = getIQChildElementBuilder(new IQChildElementXmlStringBuilder(this));
    xml.closeElement(this);
    return xml;
}
Also used : IQChildElementXmlStringBuilder(org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder) IQChildElementXmlStringBuilder(org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder) XmlStringBuilder(org.jivesoftware.smack.util.XmlStringBuilder)

Aggregations

XmlStringBuilder (org.jivesoftware.smack.util.XmlStringBuilder)59 IQChildElementXmlStringBuilder (org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 ObjectOutputStream (java.io.ObjectOutputStream)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 Element (org.jivesoftware.smack.packet.Element)1 ExtensionElement (org.jivesoftware.smack.packet.ExtensionElement)1 MultiMap (org.jivesoftware.smack.util.MultiMap)1 FormField (org.jivesoftware.smackx.xdata.FormField)1