Search in sources :

Example 16 with XmlStringBuilder

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

the class DelayInformation method toXML.

@Override
public XmlStringBuilder toXML() {
    XmlStringBuilder xml = new XmlStringBuilder(this);
    xml.attribute("stamp", XmppDateTime.formatXEP0082Date(stamp));
    xml.optAttribute("from", from);
    xml.rightAngleBracket();
    xml.optAppend(reason);
    xml.closeElement(this);
    return xml;
}
Also used : XmlStringBuilder(org.jivesoftware.smack.util.XmlStringBuilder)

Example 17 with XmlStringBuilder

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

the class RosterVer method toXML.

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

Example 18 with XmlStringBuilder

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

the class Destroy method toXML.

@Override
public XmlStringBuilder toXML() {
    XmlStringBuilder xml = new XmlStringBuilder(this);
    xml.optAttribute("jid", getJid());
    xml.rightAngleBracket();
    xml.optElement("reason", getReason());
    xml.closeElement(this);
    return xml;
}
Also used : XmlStringBuilder(org.jivesoftware.smack.util.XmlStringBuilder)

Example 19 with XmlStringBuilder

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

the class GroupChatInvitation method toXML.

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

Example 20 with XmlStringBuilder

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

the class DataForm method toXML.

@Override
public XmlStringBuilder toXML() {
    XmlStringBuilder buf = new XmlStringBuilder(this);
    buf.attribute("type", getType());
    buf.rightAngleBracket();
    buf.optElement("title", getTitle());
    for (String instruction : getInstructions()) {
        buf.element("instructions", instruction);
    }
    // Append the list of fields returned from a search
    if (getReportedData() != null) {
        buf.append(getReportedData().toXML());
    }
    // Loop through all the items returned from a search and append them to the string buffer
    for (Item item : getItems()) {
        buf.append(item.toXML());
    }
    // Loop through all the form fields and append them to the string buffer
    for (FormField field : getFields()) {
        buf.append(field.toXML());
    }
    for (Element element : extensionElements) {
        buf.append(element.toXML());
    }
    buf.closeElement(this);
    return buf;
}
Also used : ExtensionElement(org.jivesoftware.smack.packet.ExtensionElement) Element(org.jivesoftware.smack.packet.Element) XmlStringBuilder(org.jivesoftware.smack.util.XmlStringBuilder) FormField(org.jivesoftware.smackx.xdata.FormField)

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