Java Code Examples for org.jivesoftware.smack.util.XmlStringBuilder#append()
The following examples show how to use
org.jivesoftware.smack.util.XmlStringBuilder#append() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Range.java From Smack with Apache License 2.0 | 6 votes |
@Override public CharSequence toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) { XmlStringBuilder sb = new XmlStringBuilder(this); sb.optAttribute(ATTR_OFFSET, offset); sb.optAttribute(ATTR_LENGTH, length); if (hash != null) { sb.rightAngleBracket(); sb.append(hash); sb.closeElement(this); } else { sb.closeEmptyElement(); } return sb; }
Example 2
Source File: DataFormsXmlElement.java From Smack with Apache License 2.0 | 5 votes |
@Override public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) { XmlStringBuilder xml = new XmlStringBuilder(this, xmlEnvironment); if (payload == null) { return xml.closeEmptyElement(); } xml.rightAngleBracket(); xml.append(payload.toXML()); xml.closeElement(this); return xml; }
Example 3
Source File: DataForm.java From Smack with Apache License 2.0 | 5 votes |
@Override public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) { XmlStringBuilder xml = new XmlStringBuilder(this, xmlEnvironment); xml.rightAngleBracket(); xml.append(getFields()); xml.closeElement(this); return xml; }
Example 4
Source File: FasteningElement.java From Smack with Apache License 2.0 | 5 votes |
private void addPayloads(XmlStringBuilder xml) { for (ExternalElement external : externalPayloads) { xml.append(external); } for (ExtensionElement wrapped : wrappedPayloads) { xml.append(wrapped); } }
Example 5
Source File: Checksum.java From Smack with Apache License 2.0 | 5 votes |
@Override public CharSequence toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) { XmlStringBuilder sb = new XmlStringBuilder(this); sb.optAttribute(ATTR_CREATOR, creator); sb.optAttribute(ATTR_NAME, name); sb.rightAngleBracket(); sb.append(file); sb.closeElement(this); return sb; }
Example 6
Source File: AffiliationsExtension.java From Smack with Apache License 2.0 | 5 votes |
@Override protected void addXml(XmlStringBuilder xml) { if ((items == null) || (items.size() == 0)) { xml.closeEmptyElement(); return; } xml.rightAngleBracket(); xml.append(items); xml.closeElement(this); }
Example 7
Source File: Base64BinaryChunk.java From Smack with Apache License 2.0 | 5 votes |
@Override public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) { XmlStringBuilder xml = new XmlStringBuilder(this); xml.attribute("streamId", streamId); xml.attribute("nr", nr); xml.optBooleanAttribute("last", last); xml.rightAngleBracket(); xml.append(text); xml.closeElement(this); return xml; }
Example 8
Source File: DataLayout.java From Smack with Apache License 2.0 | 5 votes |
@Override public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) { XmlStringBuilder buf = new XmlStringBuilder(this, enclosingNamespace); buf.optAttribute("label", getLabel()); buf.rightAngleBracket(); buf.append(getSectionLayout()); buf.closeElement(ELEMENT); return buf; }
Example 9
Source File: JingleContentDescription.java From Smack with Apache License 2.0 | 5 votes |
@Override public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) { XmlStringBuilder xml = new XmlStringBuilder(this); addExtraAttributes(xml); xml.rightAngleBracket(); xml.append(payloads); xml.closeElement(this); return xml; }
Example 10
Source File: JingleReason.java From Smack with Apache License 2.0 | 5 votes |
@Override public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) { XmlStringBuilder xml = new XmlStringBuilder(this); xml.rightAngleBracket(); xml.openElement(reason.asString); xml.openElement(SID); xml.append(sessionId); xml.closeElement(SID); xml.closeElement(reason.asString); xml.closeElement(this); return xml; }
Example 11
Source File: OpenPgpContentElement.java From Smack with Apache License 2.0 | 5 votes |
protected void addCommonXml(XmlStringBuilder xml) { for (Jid toJid : to != null ? to : Collections.<Jid>emptySet()) { xml.halfOpenElement(ELEM_TO).attribute(ATTR_JID, toJid).closeEmptyElement(); } ensureTimestampStringSet(); xml.halfOpenElement(ELEM_TIME).attribute(ATTR_STAMP, timestampString).closeEmptyElement(); xml.openElement(ELEM_PAYLOAD); for (ExtensionElement element : payload.values()) { xml.append(element.toXML(getNamespace())); } xml.closeElement(ELEM_PAYLOAD); }
Example 12
Source File: MediaElement.java From Smack with Apache License 2.0 | 5 votes |
@Override public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) { XmlStringBuilder xml = new XmlStringBuilder(this, xmlEnvironment); xml.optAttribute("height", height) .optAttribute("width", width) .rightAngleBracket(); xml.append(uris); xml.closeElement(this); return xml; }
Example 13
Source File: Presence.java From Smack with Apache License 2.0 | 5 votes |
@Override public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) { XmlStringBuilder buf = new XmlStringBuilder(this, enclosingNamespace); addCommonAttributes(buf); if (type != Type.available) { buf.attribute("type", type); } List<ExtensionElement> extensions = getExtensions(); if (status == null && priority == null && (mode == null || mode == Mode.available) && extensions.isEmpty() && getError() == null) { return buf.closeEmptyElement(); } buf.rightAngleBracket(); buf.optElement("status", status); buf.optElement("priority", priority); if (mode != null && mode != Mode.available) { buf.element("show", mode); } buf.append(extensions); // Add the error sub-packet, if there is one. appendErrorIfExists(buf); buf.closeElement(ELEMENT); return buf; }
Example 14
Source File: NodeElement.java From Smack with Apache License 2.0 | 5 votes |
@Override public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) { XmlStringBuilder xml = new XmlStringBuilder(this, enclosingNamespace); nodeInfo.appendTo(xml); xml.rightAngleBracket(); xml.append(timestampElements); xml.closeElement(this); return xml; }
Example 15
Source File: DataForm.java From Smack with Apache License 2.0 | 5 votes |
@Override public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) { XmlStringBuilder xml = new XmlStringBuilder(this, xmlEnvironment); xml.rightAngleBracket(); xml.append(getFields()); xml.closeElement(this); return xml; }
Example 16
Source File: AbstractError.java From Smack with Apache License 2.0 | 5 votes |
protected void addDescriptiveTextsAndExtensions(XmlStringBuilder xml) { for (Map.Entry<String, String> entry : descriptiveTexts.entrySet()) { String xmllang = entry.getKey(); String text = entry.getValue(); xml.halfOpenElement("text").xmlnsAttribute(textNamespace) .optXmlLangAttribute(xmllang) .rightAngleBracket(); xml.escape(text); xml.closeElement("text"); } xml.append(extensions); }
Example 17
Source File: OmemoElement.java From Smack with Apache License 2.0 | 5 votes |
@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; }
Example 18
Source File: MultipleAddresses.java From Smack with Apache License 2.0 | 5 votes |
@Override public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) { XmlStringBuilder buf = new XmlStringBuilder(this); buf.rightAngleBracket(); // Loop through all the addresses and append them to the string buffer for (Address address : addresses) { buf.append(address.toXML()); } buf.closeElement(this); return buf; }
Example 19
Source File: OmemoKeyElement.java From Smack with Apache License 2.0 | 5 votes |
@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; }
Example 20
Source File: Forwarded.java From Smack with Apache License 2.0 | 5 votes |
@Override public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) { XmlStringBuilder xml = new XmlStringBuilder(this, enclosingNamespace); xml.rightAngleBracket(); xml.optElement(getDelayInformation()); xml.append(forwardedPacket); xml.closeElement(this); return xml; }