mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-08 22:21:08 +01:00
Introduce XmlEnvironment
This commit is contained in:
parent
dc780ffd6c
commit
fee3ed81ca
229 changed files with 715 additions and 526 deletions
|
|
@ -211,19 +211,19 @@ public class MultipleRecipientManager {
|
|||
if (to != null) {
|
||||
for (Jid jid : to) {
|
||||
packet.setTo(jid);
|
||||
connection.sendStanza(new PacketCopy(packet.toXML(null)));
|
||||
connection.sendStanza(new PacketCopy(packet.toXML()));
|
||||
}
|
||||
}
|
||||
if (cc != null) {
|
||||
for (Jid jid : cc) {
|
||||
packet.setTo(jid);
|
||||
connection.sendStanza(new PacketCopy(packet.toXML(null)));
|
||||
connection.sendStanza(new PacketCopy(packet.toXML()));
|
||||
}
|
||||
}
|
||||
if (bcc != null) {
|
||||
for (Jid jid : bcc) {
|
||||
packet.setTo(jid);
|
||||
connection.sendStanza(new PacketCopy(packet.toXML(null)));
|
||||
connection.sendStanza(new PacketCopy(packet.toXML()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -309,13 +309,13 @@ public class MultipleRecipientManager {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
public CharSequence toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
return text;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return toXML(null).toString();
|
||||
return toXML().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,12 +118,12 @@ public class MultipleAddresses implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
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(null));
|
||||
buf.append(address.toXML());
|
||||
}
|
||||
buf.closeElement(this);
|
||||
return buf;
|
||||
|
|
@ -194,7 +194,7 @@ public class MultipleAddresses implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder();
|
||||
buf.halfOpenElement(this).attribute("type", type);
|
||||
buf.optAttribute("jid", jid);
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ public class AMPExtension implements ExtensionElement {
|
|||
* Returns the XML representation of a XHTML extension according the specification.
|
||||
**/
|
||||
@Override
|
||||
public String toXML(String enclosingNamespace) {
|
||||
public String toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
buf.append('<').append(getElementName()).append(" xmlns=\"").append(getNamespace()).append('"');
|
||||
if (status != null) {
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public class AttentionExtension implements ExtensionElement {
|
|||
* @see org.jivesoftware.smack.packet.PacketExtension#toXML()
|
||||
*/
|
||||
@Override
|
||||
public String toXML(String enclosingNamespace) {
|
||||
public String toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append('<').append(getElementName()).append(" xmlns=\"").append(
|
||||
getNamespace()).append("\"/>");
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class BlockedErrorExtension implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
public CharSequence toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.closeEmptyElement();
|
||||
return xml;
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class BoBExtension extends XHTMLExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ public class DataPacketExtension implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = getIQChildElementBuilder(new IQChildElementXmlStringBuilder(this));
|
||||
xml.closeElement(this);
|
||||
return xml;
|
||||
|
|
|
|||
|
|
@ -232,11 +232,11 @@ public class Bytestream extends IQ {
|
|||
xml.rightAngleBracket();
|
||||
if (getToActivate() == null) {
|
||||
for (StreamHost streamHost : getStreamHosts()) {
|
||||
xml.append(streamHost.toXML(null));
|
||||
xml.append(streamHost.toXML());
|
||||
}
|
||||
}
|
||||
else {
|
||||
xml.append(getToActivate().toXML(null));
|
||||
xml.append(getToActivate().toXML());
|
||||
}
|
||||
break;
|
||||
case result:
|
||||
|
|
@ -246,7 +246,7 @@ public class Bytestream extends IQ {
|
|||
// constructions mechanisms of Bytestream
|
||||
// A result from the server can also contain stream hosts
|
||||
for (StreamHost host : streamHosts) {
|
||||
xml.append(host.toXML(null));
|
||||
xml.append(host.toXML());
|
||||
}
|
||||
break;
|
||||
case get:
|
||||
|
|
@ -325,7 +325,7 @@ public class Bytestream extends IQ {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.attribute("jid", getJID());
|
||||
xml.attribute("host", getAddress());
|
||||
|
|
@ -375,7 +375,7 @@ public class Bytestream extends IQ {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.attribute("jid", getJID());
|
||||
xml.closeEmptyElement();
|
||||
|
|
@ -418,7 +418,7 @@ public class Bytestream extends IQ {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
xml.escape(getTarget());
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ public class SimpleDirectoryPersistentCache implements EntityCapsPersistentCache
|
|||
*/
|
||||
private static void writeInfoToFile(File file, DiscoverInfo info) throws IOException {
|
||||
try (DataOutputStream dos = new DataOutputStream(new FileOutputStream(file))) {
|
||||
dos.writeUTF(info.toXML(null).toString());
|
||||
dos.writeUTF(info.toXML().toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public class CapsExtension implements ExtensionElement {
|
|||
*
|
||||
*/
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.attribute("hash", hash).attribute("node", node).attribute("ver", ver);
|
||||
xml.closeEmptyElement();
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public class ChatStateExtension implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.closeEmptyElement();
|
||||
return xml;
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ public class AdHocCommandData extends IQ {
|
|||
}
|
||||
|
||||
if (form != null) {
|
||||
xml.append(form.toXML(null));
|
||||
xml.append(form.toXML());
|
||||
}
|
||||
|
||||
for (AdHocCommandNote note : notes) {
|
||||
|
|
@ -264,7 +264,7 @@ public class AdHocCommandData extends IQ {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toXML(String enclosingNamespace) {
|
||||
public String toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
buf.append('<').append(getElementName());
|
||||
buf.append(" xmlns=\"").append(getNamespace()).append("\"/>");
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ public class DelayInformation implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.attribute("stamp", XmppDateTime.formatXEP0082Date(stamp));
|
||||
xml.optAttribute("from", from);
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public class Forwarded implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
xml.optElement(getDelayInformation());
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ public final class GeoLocation implements Serializable, ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
public CharSequence toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
xml.optElement("accuracy", accuracy);
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ public class Registration extends IQ {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
public CharSequence toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
return '<' + ELEMENT + " xmlns='" + NAMESPACE + "'/>";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ public final class JingleContent implements NamedElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.attribute(CREATOR_ATTRIBUTE_NAME, creator);
|
||||
xml.optAttribute(DISPOSITION_ATTRIBUTE_NAME, disposition);
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public abstract class JingleContentDescription implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
addExtraAttributes(xml);
|
||||
xml.rightAngleBracket();
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ public abstract class JingleContentTransport implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
addExtraAttributes(xml);
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public final class JingleError implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.closeEmptyElement();
|
||||
return xml;
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ public class JingleReason implements NamedElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ public class JingleReason implements NamedElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2017 Florian Schmaus.
|
||||
* Copyright 2017-2019 Florian Schmaus.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -17,6 +17,7 @@
|
|||
package org.jivesoftware.smackx.jingle.element;
|
||||
|
||||
import org.jivesoftware.smack.packet.StandardExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
||||
public final class UnknownJingleContentDescription extends JingleContentDescription {
|
||||
|
|
@ -39,8 +40,8 @@ public final class UnknownJingleContentDescription extends JingleContentDescript
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
return standardExtensionElement.toXML(null);
|
||||
public XmlStringBuilder toXML(XmlEnvironment enclosingXmlEnvironment) {
|
||||
return standardExtensionElement.toXML(enclosingXmlEnvironment);
|
||||
}
|
||||
|
||||
public StandardExtensionElement getStandardExtensionElement() {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2017 Florian Schmaus.
|
||||
* Copyright 2017-2019 Florian Schmaus.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -19,6 +19,7 @@ package org.jivesoftware.smackx.jingle.element;
|
|||
import java.util.List;
|
||||
|
||||
import org.jivesoftware.smack.packet.StandardExtensionElement;
|
||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
||||
public final class UnknownJingleContentTransport extends JingleContentTransport {
|
||||
|
|
@ -41,8 +42,8 @@ public final class UnknownJingleContentTransport extends JingleContentTransport
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
return standardExtensionElement.toXML(null);
|
||||
public XmlStringBuilder toXML(XmlEnvironment enclosingXmlEnvironment) {
|
||||
return standardExtensionElement.toXML(enclosingXmlEnvironment);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -92,6 +92,6 @@ public class JingleIBBTransport extends JingleContentTransport {
|
|||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.toXML(null).toString().hashCode();
|
||||
return this.toXML().toString().hashCode();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ public final class JingleS5BTransportCandidate extends JingleContentTransportCan
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
public CharSequence toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder();
|
||||
xml.halfOpenElement(this);
|
||||
xml.attribute(ATTR_CID, cid);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public abstract class JingleS5BTransportInfo extends JingleContentTransportInfo
|
|||
}
|
||||
|
||||
@Override
|
||||
public final XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public final XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder();
|
||||
xml.halfOpenElement(this);
|
||||
xml.attribute(ATTR_CID, getCandidateId());
|
||||
|
|
@ -53,12 +53,12 @@ public abstract class JingleS5BTransportInfo extends JingleContentTransportInfo
|
|||
}
|
||||
|
||||
JingleS5BCandidateTransportInfo otherCandidateTransportInfo = (JingleS5BCandidateTransportInfo) other;
|
||||
return toXML(null).equals(otherCandidateTransportInfo.toXML(null));
|
||||
return toXML().toString().equals(otherCandidateTransportInfo.toXML().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int hashCode() {
|
||||
return getCandidateId().hashCode();
|
||||
return getCandidateId().toString().hashCode();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -102,7 +102,7 @@ public abstract class JingleS5BTransportInfo extends JingleContentTransportInfo
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder();
|
||||
xml.halfOpenElement(this);
|
||||
xml.closeEmptyElement();
|
||||
|
|
@ -116,7 +116,7 @@ public abstract class JingleS5BTransportInfo extends JingleContentTransportInfo
|
|||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return toXML(null).toString().hashCode();
|
||||
return toXML().toString().hashCode();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -134,7 +134,7 @@ public abstract class JingleS5BTransportInfo extends JingleContentTransportInfo
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
public CharSequence toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder();
|
||||
xml.halfOpenElement(this);
|
||||
xml.closeEmptyElement();
|
||||
|
|
@ -148,7 +148,7 @@ public abstract class JingleS5BTransportInfo extends JingleContentTransportInfo
|
|||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return toXML(null).toString().hashCode();
|
||||
return toXML().toString().hashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ public class JivePropertiesExtension implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
public CharSequence toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
// Loop through all properties and write them out.
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ public class IdleElement implements ExtensionElement {
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
return new XmlStringBuilder(this)
|
||||
.attribute(ATTR_SINCE, since)
|
||||
.closeEmptyElement();
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class MessageCorrectExtension implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.attribute(ID_TAG, getIdInitialMessage());
|
||||
xml.closeEmptyElement();
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import org.jivesoftware.smack.util.XmlStringBuilder;
|
|||
public abstract class MoodConcretisation implements ExtensionElement {
|
||||
|
||||
@Override
|
||||
public final XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public final XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
return new XmlStringBuilder(this).closeEmptyElement();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ public class MoodElement implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
|
||||
if (mood == null && text == null) {
|
||||
|
|
@ -167,7 +167,7 @@ public class MoodElement implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder();
|
||||
|
||||
if (concretisation == null) {
|
||||
|
|
@ -175,7 +175,7 @@ public class MoodElement implements ExtensionElement {
|
|||
}
|
||||
|
||||
return xml.openElement(getElementName())
|
||||
.append(concretisation.toXML(null))
|
||||
.append(concretisation.toXML())
|
||||
.closeElement(getElementName());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ public final class MultiUserChatManager extends Manager {
|
|||
if (mucUser.getInvite() != null) {
|
||||
EntityBareJid mucJid = message.getFrom().asEntityBareJidIfPossible();
|
||||
if (mucJid == null) {
|
||||
LOGGER.warning("Invite to non bare JID: '" + message.toXML(null) + "'");
|
||||
LOGGER.warning("Invite to non bare JID: '" + message.toXML() + "'");
|
||||
return;
|
||||
}
|
||||
// Fire event for invitation listeners
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ public class RoomInfo {
|
|||
if (!identities.isEmpty()) {
|
||||
this.name = identities.get(0).getName();
|
||||
} else {
|
||||
LOGGER.warning("DiscoverInfo does not contain any Identity: " + info.toXML(null));
|
||||
LOGGER.warning("DiscoverInfo does not contain any Identity: " + info.toXML());
|
||||
this.name = "";
|
||||
}
|
||||
String subject = "";
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public class Destroy implements NamedElement, Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.optAttribute("jid", getJid());
|
||||
xml.rightAngleBracket();
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ public class GroupChatInvitation implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.attribute("jid", getRoomAddress());
|
||||
xml.closeEmptyElement();
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public class MUCAdmin extends IQ {
|
|||
|
||||
synchronized (items) {
|
||||
for (MUCItem item : items) {
|
||||
xml.append(item.toXML(null));
|
||||
xml.append(item.toXML());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ public class MUCInitialPresence implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
xml.optElement("password", getPassword());
|
||||
|
|
@ -286,7 +286,7 @@ public class MUCInitialPresence implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.optIntAttribute("maxchars", getMaxChars());
|
||||
xml.optIntAttribute("maxstanzas", getMaxStanzas());
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ public class MUCItem implements NamedElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.optAttribute("affiliation", getAffiliation());
|
||||
xml.optAttribute("jid", getJid());
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ public class MUCOwner extends IQ {
|
|||
|
||||
synchronized (items) {
|
||||
for (MUCItem item : items) {
|
||||
xml.append(item.toXML(null));
|
||||
xml.append(item.toXML());
|
||||
}
|
||||
}
|
||||
xml.optElement(getDestroy());
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class MUCUser implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
xml.optElement(getInvite());
|
||||
|
|
@ -301,7 +301,7 @@ public class MUCUser implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.optAttribute("to", getTo());
|
||||
xml.optAttribute("from", getFrom());
|
||||
|
|
@ -369,7 +369,7 @@ public class MUCUser implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.optAttribute("to", getTo());
|
||||
xml.optAttribute("from", getFrom());
|
||||
|
|
@ -439,7 +439,7 @@ public class MUCUser implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.attribute("code", getCode());
|
||||
xml.closeEmptyElement();
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public class Nick implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this, enclosingNamespace);
|
||||
xml.rightAngleBracket();
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ public class OfflineMessageInfo implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toXML(String enclosingNamespace) {
|
||||
public String toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
buf.append('<').append(getElementName()).append(" xmlns=\"").append(getNamespace()).append(
|
||||
"\">");
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ public class Affiliation implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.optAttribute("node", node);
|
||||
xml.optAttribute("jid", jid);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class AffiliationsExtension extends NodeExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
public CharSequence toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
if ((items == null) || (items.size() == 0)) {
|
||||
return super.toXML(enclosingNamespace);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,10 +76,10 @@ public class EventElement implements EmbeddedPacketExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
xml.append(ext.toXML(null));
|
||||
xml.append(ext.toXML());
|
||||
xml.closeElement(this);
|
||||
return xml;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public class FormNode extends NodeExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
public CharSequence toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
if (configForm == null) {
|
||||
return super.toXML(enclosingNamespace);
|
||||
}
|
||||
|
|
@ -84,7 +84,7 @@ public class FormNode extends NodeExtension {
|
|||
}
|
||||
else
|
||||
builder.append('>');
|
||||
builder.append(configForm.getDataFormToSend().toXML(null));
|
||||
builder.append(configForm.getDataFormToSend().toXML());
|
||||
builder.append("</");
|
||||
builder.append(getElementName() + '>');
|
||||
return builder.toString();
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public class GetItemsRequest extends NodeExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder();
|
||||
xml.halfOpenElement(getElementName());
|
||||
xml.attribute("node", getNode());
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ public class Item extends NodeExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = getCommonXml();
|
||||
|
||||
xml.closeEmptyElement();
|
||||
|
|
@ -166,7 +166,7 @@ public class Item extends NodeExtension {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getName() + " | Content [" + toXML(null) + "]";
|
||||
return getClass().getName() + " | Content [" + toXML() + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ public class ItemsExtension extends NodeExtension implements EmbeddedPacketExten
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
public CharSequence toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
if ((items == null) || (items.size() == 0)) {
|
||||
return super.toXML(enclosingNamespace);
|
||||
}
|
||||
|
|
@ -169,7 +169,7 @@ public class ItemsExtension extends NodeExtension implements EmbeddedPacketExten
|
|||
else {
|
||||
builder.append("'>");
|
||||
for (NamedElement item : items) {
|
||||
builder.append(item.toXML(null));
|
||||
builder.append(item.toXML());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -182,7 +182,7 @@ public class ItemsExtension extends NodeExtension implements EmbeddedPacketExten
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getName() + "Content [" + toXML(null) + "]";
|
||||
return getClass().getName() + "Content [" + toXML() + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,12 +78,12 @@ public class NodeExtension implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
public CharSequence toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
return '<' + getElementName() + (node == null ? "" : " node='" + node + '\'') + "/>";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getName() + " - content [" + toXML(null) + "]";
|
||||
return getClass().getName() + " - content [" + toXML() + "]";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public class OptionsExtension extends NodeExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder();
|
||||
xml.halfOpenElement(getElementName());
|
||||
xml.attribute("jid", jid);
|
||||
|
|
|
|||
|
|
@ -130,11 +130,11 @@ public class PayloadItem<E extends ExtensionElement> extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = getCommonXml();
|
||||
|
||||
xml.rightAngleBracket();
|
||||
xml.append(payload.toXML(null));
|
||||
xml.append(payload.toXML());
|
||||
xml.closeElement(this);
|
||||
|
||||
return xml;
|
||||
|
|
@ -142,6 +142,6 @@ public class PayloadItem<E extends ExtensionElement> extends Item {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getName() + " | Content [" + toXML(null) + "]";
|
||||
return getClass().getName() + " | Content [" + toXML() + "]";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class PublishItem<T extends Item> extends NodeExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toXML(String enclosingNamespace) {
|
||||
public String toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
StringBuilder builder = new StringBuilder("<");
|
||||
builder.append(getElementName());
|
||||
builder.append(" node='");
|
||||
|
|
@ -59,7 +59,7 @@ public class PublishItem<T extends Item> extends NodeExtension {
|
|||
builder.append("'>");
|
||||
|
||||
for (Item item : items) {
|
||||
builder.append(item.toXML(null));
|
||||
builder.append(item.toXML());
|
||||
}
|
||||
builder.append("</publish>");
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public class RetractItem implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toXML(String enclosingNamespace) {
|
||||
public String toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
return "<retract id='" + id + "'/>";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,12 +93,12 @@ public class SimplePayload implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toXML(String enclosingNamespace) {
|
||||
public String toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
return payload;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getName() + "payload [" + toXML(null) + "]";
|
||||
return getClass().getName() + "payload [" + toXML() + "]";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class SubscribeExtension extends NodeExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toXML(String enclosingNamespace) {
|
||||
public String toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
StringBuilder builder = new StringBuilder("<");
|
||||
builder.append(getElementName());
|
||||
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ public class Subscription extends NodeExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder builder = new XmlStringBuilder(this);
|
||||
builder.attribute("jid", jid);
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public class SubscriptionsExtension extends NodeExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CharSequence toXML(String enclosingNamespace) {
|
||||
public CharSequence toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
if ((items == null) || (items.size() == 0)) {
|
||||
return super.toXML(enclosingNamespace);
|
||||
}
|
||||
|
|
@ -107,7 +107,7 @@ public class SubscriptionsExtension extends NodeExtension {
|
|||
builder.append('>');
|
||||
|
||||
for (Subscription item : items) {
|
||||
builder.append(item.toXML(null));
|
||||
builder.append(item.toXML());
|
||||
}
|
||||
|
||||
builder.append("</");
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class UnsubscribeExtension extends NodeExtension {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder();
|
||||
xml.halfOpenElement(getElementName());
|
||||
xml.attribute("jid", jid);
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public class DeliveryReceipt implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.optAttribute("id", id);
|
||||
xml.closeEmptyElement();
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class DeliveryReceiptRequest implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toXML(String enclosingNamespace) {
|
||||
public String toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
return "<request xmlns='" + DeliveryReceipt.NAMESPACE + "'/>";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ public class RSMSet implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
xml.optElement("after", after);
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public class Header implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
// Upcast to NamedElement since we don't want a xmlns attribute
|
||||
XmlStringBuilder xml = new XmlStringBuilder((NamedElement) this);
|
||||
xml.attribute("name", name);
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public class HeadersExtension implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
xml.append(headers);
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ public class StreamInitiation extends IQ {
|
|||
buf.rightAngleBracket();
|
||||
|
||||
// Add the file section if there is one.
|
||||
buf.optAppend(file.toXML(null));
|
||||
buf.optAppend(file.toXML());
|
||||
break;
|
||||
case result:
|
||||
buf.rightAngleBracket();
|
||||
|
|
@ -155,7 +155,7 @@ public class StreamInitiation extends IQ {
|
|||
throw new IllegalArgumentException("IQ Type not understood");
|
||||
}
|
||||
if (featureNegotiation != null) {
|
||||
buf.append(featureNegotiation.toXML(null));
|
||||
buf.append(featureNegotiation.toXML());
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
|
@ -327,7 +327,7 @@ public class StreamInitiation extends IQ {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toXML(String enclosingNamespace) {
|
||||
public String toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
|
||||
buffer.append('<').append(getElementName()).append(" xmlns=\"")
|
||||
|
|
@ -405,11 +405,11 @@ public class StreamInitiation extends IQ {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toXML(String enclosingNamespace) {
|
||||
public String toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
buf
|
||||
.append("<feature xmlns=\"http://jabber.org/protocol/feature-neg\">");
|
||||
buf.append(data.toXML(null));
|
||||
buf.append(data.toXML());
|
||||
buf.append("</feature>");
|
||||
return buf.toString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
|
||||
import org.jivesoftware.smack.packet.NamedElement;
|
||||
import org.jivesoftware.smack.packet.XmlEnvironment;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
||||
|
|
@ -433,7 +434,7 @@ public class FormField implements NamedElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder(this);
|
||||
// Add attributes
|
||||
buf.optAttribute("label", getLabel());
|
||||
|
|
@ -449,7 +450,7 @@ public class FormField implements NamedElement {
|
|||
}
|
||||
// Loop through all the values and append them to the string buffer
|
||||
for (Option option : getOptions()) {
|
||||
buf.append(option.toXML(null));
|
||||
buf.append(option.toXML());
|
||||
}
|
||||
buf.optElement(validateElement);
|
||||
buf.closeElement(this);
|
||||
|
|
@ -467,12 +468,12 @@ public class FormField implements NamedElement {
|
|||
|
||||
FormField other = (FormField) obj;
|
||||
|
||||
return toXML(null).equals(other.toXML(null));
|
||||
return toXML().toString().equals(other.toXML().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return toXML(null).hashCode();
|
||||
return toXML().toString().hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -525,7 +526,7 @@ public class FormField implements NamedElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
// Add attribute
|
||||
xml.optAttribute("label", getLabel());
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ public class DataForm implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder(this);
|
||||
buf.attribute("type", getType());
|
||||
buf.rightAngleBracket();
|
||||
|
|
@ -331,10 +331,10 @@ public class DataForm implements ExtensionElement {
|
|||
}
|
||||
// Loop through all the form fields and append them to the string buffer
|
||||
for (FormField field : getFields()) {
|
||||
buf.append(field.toXML(null));
|
||||
buf.append(field.toXML());
|
||||
}
|
||||
for (Element element : extensionElements) {
|
||||
buf.append(element.toXML(null));
|
||||
buf.append(element.toXML());
|
||||
}
|
||||
buf.closeElement(this);
|
||||
return buf;
|
||||
|
|
@ -379,7 +379,7 @@ public class DataForm implements ExtensionElement {
|
|||
buf.openElement(ELEMENT);
|
||||
// Loop through all the form items and append them to the string buffer
|
||||
for (FormField field : getFields()) {
|
||||
buf.append(field.toXML(null));
|
||||
buf.append(field.toXML());
|
||||
}
|
||||
buf.closeElement(ELEMENT);
|
||||
return buf;
|
||||
|
|
@ -415,7 +415,7 @@ public class DataForm implements ExtensionElement {
|
|||
buf.openElement(ELEMENT);
|
||||
// Loop through all the form items and append them to the string buffer
|
||||
for (FormField field : getFields()) {
|
||||
buf.append(field.toXML(null));
|
||||
buf.append(field.toXML());
|
||||
}
|
||||
buf.closeElement(ELEMENT);
|
||||
return buf;
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public class DataLayout implements ExtensionElement {
|
|||
* @see org.jivesoftware.smack.packet.PacketExtension#toXML()
|
||||
*/
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder(this);
|
||||
buf.optAttribute("label", getLabel());
|
||||
buf.rightAngleBracket();
|
||||
|
|
@ -109,7 +109,7 @@ public class DataLayout implements ExtensionElement {
|
|||
*/
|
||||
private static void walkList(XmlStringBuilder buf, List<DataFormLayoutElement> pageLayout) {
|
||||
for (DataFormLayoutElement object : pageLayout) {
|
||||
buf.append(object.toXML(null));
|
||||
buf.append(object.toXML());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -127,7 +127,7 @@ public class DataLayout implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder(this);
|
||||
buf.attribute("var", getVar());
|
||||
buf.closeEmptyElement();
|
||||
|
|
@ -187,7 +187,7 @@ public class DataLayout implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder(this);
|
||||
buf.optAttribute("label", getLabel());
|
||||
buf.rightAngleBracket();
|
||||
|
|
@ -218,7 +218,7 @@ public class DataLayout implements ExtensionElement {
|
|||
public static final String ELEMENT = "reportedref";
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder(this);
|
||||
buf.closeEmptyElement();
|
||||
return buf;
|
||||
|
|
@ -244,7 +244,7 @@ public class DataLayout implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder();
|
||||
buf.element(ELEMENT, getText());
|
||||
return buf;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ public abstract class ValidateElement implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder(this);
|
||||
buf.optAttribute("datatype", datatype);
|
||||
buf.rightAngleBracket();
|
||||
|
|
@ -346,7 +346,7 @@ public abstract class ValidateElement implements ExtensionElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder buf = new XmlStringBuilder(this);
|
||||
buf.optLongAttribute("min", getMin());
|
||||
buf.optLongAttribute("max", getMax());
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ public class XHTMLExtension implements ExtensionElement {
|
|||
*
|
||||
*/
|
||||
@Override
|
||||
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
xml.rightAngleBracket();
|
||||
// Loop through all the bodies and append them to the string buffer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue