Search in sources :

Example 71 with XmlStringBuilder

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

the class CryptElement method toXML.

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

Example 72 with XmlStringBuilder

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

the class OmemoElement method toXML.

@Override
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
    XmlStringBuilder sb = new XmlStringBuilder(this, enclosingNamespace).rightAngleBracket();
    sb.append(header);
    if (payload != null) {
        sb.openElement(ATTR_PAYLOAD).append(Base64.encodeToString(payload)).closeElement(ATTR_PAYLOAD);
    }
    sb.closeElement(this);
    return sb;
}
Also used : XmlStringBuilder(org.jivesoftware.smack.util.XmlStringBuilder)

Example 73 with XmlStringBuilder

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

the class OmemoHeaderElement method toXML.

@Override
public XmlStringBuilder toXML(XmlEnvironment enclosingXmlEnvironment) {
    XmlStringBuilder sb = new XmlStringBuilder(this, enclosingXmlEnvironment);
    sb.attribute(ATTR_SID, getSid()).rightAngleBracket();
    for (OmemoKeyElement k : getKeys()) {
        sb.append(k);
    }
    sb.openElement(ATTR_IV).append(Base64.encodeToString(getIv())).closeElement(ATTR_IV);
    return sb.closeElement(this);
}
Also used : XmlStringBuilder(org.jivesoftware.smack.util.XmlStringBuilder)

Example 74 with XmlStringBuilder

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

the class OmemoKeyElement method toXML.

@Override
public XmlStringBuilder toXML(XmlEnvironment enclosingXmlEnvironment) {
    XmlStringBuilder sb = new XmlStringBuilder(this, enclosingXmlEnvironment);
    if (isPreKey()) {
        sb.attribute(ATTR_PREKEY, true);
    }
    sb.attribute(ATTR_RID, getId());
    sb.rightAngleBracket();
    sb.append(Base64.encodeToString(getData()));
    sb.closeElement(this);
    return sb;
}
Also used : XmlStringBuilder(org.jivesoftware.smack.util.XmlStringBuilder)

Example 75 with XmlStringBuilder

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

the class WebSocketOpenElement method toXML.

@Override
public CharSequence toXML(XmlEnvironment xmlEnvironment) {
    XmlStringBuilder xml = new XmlStringBuilder(this);
    addCommonAttributes(xml);
    xml.closeEmptyElement();
    return xml;
}
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