Search in sources :

Example 21 with XmlStringBuilder

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

the class DeliveryReceipt method toXML.

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

Example 22 with XmlStringBuilder

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

the class RSMSet method toXML.

@Override
public XmlStringBuilder toXML() {
    XmlStringBuilder xml = new XmlStringBuilder(this);
    xml.rightAngleBracket();
    xml.optElement("after", after);
    xml.optElement("before", before);
    xml.optIntElement("count", count);
    if (firstString != null) {
        xml.halfOpenElement("first");
        xml.optIntAttribute("index", firstIndex);
        xml.rightAngleBracket();
        xml.append(firstString);
        xml.closeElement("first");
    }
    xml.optIntElement("index", index);
    xml.optElement("last", last);
    xml.optIntElement("max", max);
    xml.closeElement(this);
    return xml;
}
Also used : XmlStringBuilder(org.jivesoftware.smack.util.XmlStringBuilder)

Example 23 with XmlStringBuilder

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

the class AffiliationsExtension method toXML.

@Override
public CharSequence toXML() {
    if ((items == null) || (items.size() == 0)) {
        return super.toXML();
    } else {
        // Can't use XmlStringBuilder(this), because we don't want the namespace to be included
        XmlStringBuilder xml = new XmlStringBuilder();
        xml.openElement(getElementName());
        xml.optAttribute("node", node);
        xml.rightAngleBracket();
        xml.append(items);
        xml.closeElement(this);
        return xml;
    }
}
Also used : XmlStringBuilder(org.jivesoftware.smack.util.XmlStringBuilder)

Example 24 with XmlStringBuilder

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

the class GetItemsRequest method toXML.

@Override
public XmlStringBuilder toXML() {
    XmlStringBuilder xml = new XmlStringBuilder();
    xml.halfOpenElement(getElementName());
    xml.attribute("node", getNode());
    xml.optAttribute("subid", getSubscriptionId());
    xml.optIntAttribute("max_items", getMaxItems());
    xml.closeEmptyElement();
    return xml;
}
Also used : XmlStringBuilder(org.jivesoftware.smack.util.XmlStringBuilder)

Example 25 with XmlStringBuilder

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

the class CarbonExtension method toXML.

@Override
public XmlStringBuilder toXML() {
    XmlStringBuilder xml = new XmlStringBuilder(this);
    xml.rightAngleBracket();
    xml.append(fwd.toXML());
    xml.closeElement(this);
    return xml;
}
Also used : 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