1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 00:59:39 +02:00

Change Element.toXml() to toXml(String enclosingNamespace)

This commit is contained in:
Florian Schmaus 2018-04-25 14:20:18 +02:00
parent 380f9a2b72
commit 5ab2903c32
229 changed files with 634 additions and 536 deletions

View file

@ -64,7 +64,7 @@ public class MetaData implements ExtensionElement {
}
@Override
public String toXML() {
public String toXML(String enclosingNamespace) {
return MetaDataUtils.serializeMetaData(this.getMetaData());
}
}

View file

@ -299,7 +299,7 @@ public class AgentRoster {
EntityFullJid from = presence.getFrom().asEntityFullJidIfPossible();
if (from == null) {
// TODO Check if we need to ignore these presences or this is a server bug?
LOGGER.warning("Presence with non full JID from: " + presence.toXML());
LOGGER.warning("Presence with non full JID from: " + presence.toXML(null));
return;
}
Jid key = getPresenceMapKey(from);

View file

@ -95,7 +95,7 @@ public class AgentStatus implements ExtensionElement {
}
@Override
public String toXML() {
public String toXML(String enclosingNamespace) {
StringBuilder buf = new StringBuilder();
buf.append('<').append(ELEMENT_NAME).append(" xmlns=\"").append(NAMESPACE).append('"');

View file

@ -107,10 +107,10 @@ public class OfferRevokeProvider extends IQProvider<IQ> {
buf.append("<reason>").append(reason).append("</reason>");
}
if (sessionID != null) {
buf.append(new SessionID(sessionID).toXML());
buf.append(new SessionID(sessionID).toXML(null));
}
if (userID != null) {
buf.append(new UserID(userID).toXML());
buf.append(new UserID(userID).toXML(null));
}
return buf;
}

View file

@ -104,7 +104,7 @@ public final class QueueDetails implements ExtensionElement {
}
@Override
public String toXML() {
public String toXML(String enclosingNamespace) {
StringBuilder buf = new StringBuilder();
buf.append('<').append(ELEMENT_NAME).append(" xmlns=\"").append(NAMESPACE).append("\">");

View file

@ -101,7 +101,7 @@ public class QueueOverview implements ExtensionElement {
}
@Override
public String toXML () {
public String toXML (String enclosingNamespace) {
StringBuilder buf = new StringBuilder();
buf.append('<').append(ELEMENT_NAME).append(" xmlns=\"").append(NAMESPACE).append("\">");

View file

@ -71,7 +71,7 @@ public class QueueUpdate implements ExtensionElement {
}
@Override
public String toXML() {
public String toXML(String enclosingNamespace) {
StringBuilder buf = new StringBuilder();
buf.append("<queue-status xmlns=\"http://jabber.org/protocol/workgroup\">");
if (position != -1) {

View file

@ -112,7 +112,7 @@ public class RoomInvitation implements ExtensionElement {
}
@Override
public XmlStringBuilder toXML() {
public XmlStringBuilder toXML(String enclosingNamespace) {
XmlStringBuilder xml = getIQChildElementBuilder(new IQChildElementXmlStringBuilder(this));
xml.closeElement(this);
return xml;

View file

@ -108,7 +108,7 @@ public class RoomTransfer implements ExtensionElement {
}
@Override
public XmlStringBuilder toXML() {
public XmlStringBuilder toXML(String enclosingNamespace) {
XmlStringBuilder xml = getIQChildElementBuilder(new IQChildElementXmlStringBuilder(this));
xml.closeElement(this);
return xml;

View file

@ -58,7 +58,7 @@ public class SessionID implements ExtensionElement {
}
@Override
public String toXML() {
public String toXML(String enclosingNamespace) {
StringBuilder buf = new StringBuilder();
buf.append('<').append(ELEMENT_NAME).append(" xmlns=\"").append(NAMESPACE).append("\" ");

View file

@ -83,7 +83,7 @@ public class Transcript extends IQ {
.append("\">");
for (Stanza packet : packets) {
buf.append(packet.toXML());
buf.append(packet.toXML(null));
}
return buf;

View file

@ -60,7 +60,7 @@ public class UserID implements ExtensionElement {
}
@Override
public String toXML() {
public String toXML(String enclosingNamespace) {
StringBuilder buf = new StringBuilder();
buf.append('<').append(ELEMENT_NAME).append(" xmlns=\"").append(NAMESPACE).append("\" ");

View file

@ -64,7 +64,7 @@ public class WorkgroupInformation implements ExtensionElement {
}
@Override
public String toXML() {
public String toXML(String enclosingNamespace) {
StringBuilder buf = new StringBuilder();
buf.append('<').append(ELEMENT_NAME);

View file

@ -587,11 +587,11 @@ public class Workgroup {
buf.append("<queue-notifications/>");
// Add the user unique identification if the session is anonymous
if (connection.isAnonymous()) {
buf.append(new UserID(userID).toXML());
buf.append(new UserID(userID).toXML(null));
}
// Append data form text
buf.append(form.toXML());
buf.append(form.toXML(null));
return buf;
}

View file

@ -306,7 +306,7 @@ public class MessageEvent implements ExtensionElement {
*
*/
@Override
public String toXML() {
public String toXML(String enclosingNamespace) {
StringBuilder buf = new StringBuilder();
buf.append('<').append(getElementName()).append(" xmlns=\"").append(getNamespace()).append(
"\">");

View file

@ -167,7 +167,7 @@ public class RosterExchange implements ExtensionElement {
*
*/
@Override
public String toXML() {
public String toXML(String enclosingNamespace) {
StringBuilder buf = new StringBuilder();
buf.append('<').append(getElementName()).append(" xmlns=\"").append(getNamespace()).append(
"\">");