Search in sources :

Example 56 with XmlStringBuilder

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

the class MUCUser method toXML.

@Override
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
    XmlStringBuilder xml = new XmlStringBuilder(this);
    xml.rightAngleBracket();
    xml.optElement(getInvite());
    xml.optElement(getDecline());
    xml.optElement(getItem());
    xml.optElement("password", getPassword());
    xml.append(statusCodes);
    xml.optElement(getDestroy());
    xml.closeElement(this);
    return xml;
}
Also used : XmlStringBuilder(org.jivesoftware.smack.util.XmlStringBuilder)

Example 57 with XmlStringBuilder

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

the class NodeExtension method toXML.

@Override
public final XmlStringBuilder toXML(XmlEnvironment enclosingNamespace) {
    XmlStringBuilder xml = new XmlStringBuilder(this, enclosingNamespace);
    xml.optAttribute("node", node);
    addXml(xml);
    return xml;
}
Also used : XmlStringBuilder(org.jivesoftware.smack.util.XmlStringBuilder)

Example 58 with XmlStringBuilder

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

the class Nick method toXML.

@Override
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
    XmlStringBuilder xml = new XmlStringBuilder(this, enclosingNamespace);
    xml.rightAngleBracket();
    xml.escape(getName());
    xml.closeElement(this);
    return xml;
}
Also used : XmlStringBuilder(org.jivesoftware.smack.util.XmlStringBuilder)

Example 59 with XmlStringBuilder

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

the class UserTuneElement method toXML.

@Override
public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) {
    XmlStringBuilder xml = new XmlStringBuilder(this);
    if (isEmptyUserTune()) {
        return xml.closeEmptyElement();
    }
    xml.rightAngleBracket();
    xml.optElement("artist", artist);
    xml.optElement("length", length);
    xml.optElement("rating", rating);
    xml.optElement("source", source);
    xml.optElement("title", title);
    xml.optElement("track", track);
    xml.optElement("uri", uri);
    return xml.closeElement(getElementName());
}
Also used : XmlStringBuilder(org.jivesoftware.smack.util.XmlStringBuilder)

Example 60 with XmlStringBuilder

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

the class FormField method toXML.

public final XmlStringBuilder toXML(XmlEnvironment enclosingNamespace, boolean includeType) {
    XmlStringBuilder buf = new XmlStringBuilder(this, enclosingNamespace);
    // Add attributes
    buf.optAttribute("label", getLabel());
    buf.optAttribute("var", getFieldName());
    if (includeType) {
        // If no 'type' is specified, the default is "text-single";
        buf.attribute("type", getType(), Type.text_single);
    }
    if (extraXmlChildElements == null) {
        // If extraXmlChildElements is null, see if they should be populated.
        populateExtraXmlChildElements();
    }
    if (formFieldChildElements.isEmpty() && (extraXmlChildElements == null || extraXmlChildElements.isEmpty())) {
        buf.closeEmptyElement();
    } else {
        buf.rightAngleBracket();
        buf.optAppend(extraXmlChildElements);
        buf.append(formFieldChildElements);
        buf.closeElement(this);
    }
    return buf;
}
Also used : XmlStringBuilder(org.jivesoftware.smack.util.XmlStringBuilder)

Aggregations

XmlStringBuilder (org.jivesoftware.smack.util.XmlStringBuilder)157 IQChildElementXmlStringBuilder (org.jivesoftware.smack.packet.IQ.IQChildElementXmlStringBuilder)6 Map (java.util.Map)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 ObjectOutputStream (java.io.ObjectOutputStream)2 LinkedHashMap (java.util.LinkedHashMap)2 MultiMap (org.jivesoftware.smack.util.MultiMap)2 FormField (org.jivesoftware.smackx.xdata.FormField)2 IOException (java.io.IOException)1 Buffer (java.nio.Buffer)1 ByteBuffer (java.nio.ByteBuffer)1 SocketChannel (java.nio.channels.SocketChannel)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 ListIterator (java.util.ListIterator)1 QName (javax.xml.namespace.QName)1 SelectionKeyAttachment (org.jivesoftware.smack.SmackReactor.SelectionKeyAttachment)1 XmppInputOutputFilter (org.jivesoftware.smack.XmppInputOutputFilter)1 SmackDebugger (org.jivesoftware.smack.debugger.SmackDebugger)1