mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-29 15:32:06 +01:00
Fix typo in XmlStringBuilder, it's not an Angel
s/rightAngelBracket/rightAngleBracket/
This commit is contained in:
parent
066a4d6c9e
commit
bbf89c65bf
33 changed files with 77 additions and 62 deletions
|
@ -55,7 +55,7 @@ public class Bind extends IQ {
|
||||||
public XmlStringBuilder getChildElementXML() {
|
public XmlStringBuilder getChildElementXML() {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder();
|
XmlStringBuilder xml = new XmlStringBuilder();
|
||||||
|
|
||||||
xml.halfOpenElement(ELEMENT).xmlnsAttribute(NAMESPACE).rightAngelBracket();
|
xml.halfOpenElement(ELEMENT).xmlnsAttribute(NAMESPACE).rightAngleBracket();
|
||||||
xml.optElement("resource", resource);
|
xml.optElement("resource", resource);
|
||||||
xml.optElement("jid", jid);
|
xml.optElement("jid", jid);
|
||||||
xml.closeElement(ELEMENT);
|
xml.closeElement(ELEMENT);
|
||||||
|
|
|
@ -84,7 +84,7 @@ public class DefaultPacketExtension implements PacketExtension {
|
||||||
@Override
|
@Override
|
||||||
public CharSequence toXML() {
|
public CharSequence toXML() {
|
||||||
XmlStringBuilder buf = new XmlStringBuilder();
|
XmlStringBuilder buf = new XmlStringBuilder();
|
||||||
buf.halfOpenElement(elementName).xmlnsAttribute(namespace).rightAngelBracket();
|
buf.halfOpenElement(elementName).xmlnsAttribute(namespace).rightAngleBracket();
|
||||||
for (String name : getNames()) {
|
for (String name : getNames()) {
|
||||||
String value = getValue(name);
|
String value = getValue(name);
|
||||||
buf.element(name, value);
|
buf.element(name, value);
|
||||||
|
|
|
@ -86,7 +86,7 @@ public abstract class IQ extends Packet {
|
||||||
else {
|
else {
|
||||||
buf.attribute("type", type.toString());
|
buf.attribute("type", type.toString());
|
||||||
}
|
}
|
||||||
buf.rightAngelBracket();
|
buf.rightAngleBracket();
|
||||||
// Add the query section if there is one.
|
// Add the query section if there is one.
|
||||||
buf.optAppend(getChildElementXML());
|
buf.optAppend(getChildElementXML());
|
||||||
// Add the error sub-packet, if there is one.
|
// Add the error sub-packet, if there is one.
|
||||||
|
|
|
@ -422,7 +422,7 @@ public class Message extends Packet {
|
||||||
if (type != Type.normal) {
|
if (type != Type.normal) {
|
||||||
buf.attribute("type", type);
|
buf.attribute("type", type);
|
||||||
}
|
}
|
||||||
buf.rightAngelBracket();
|
buf.rightAngleBracket();
|
||||||
|
|
||||||
// Add the subject in the default language
|
// Add the subject in the default language
|
||||||
Subject defaultSubject = getMessageSubject(null);
|
Subject defaultSubject = getMessageSubject(null);
|
||||||
|
@ -434,7 +434,7 @@ public class Message extends Packet {
|
||||||
// Skip the default language
|
// Skip the default language
|
||||||
if(subject.equals(defaultSubject))
|
if(subject.equals(defaultSubject))
|
||||||
continue;
|
continue;
|
||||||
buf.halfOpenElement("subject").xmllangAttribute(subject.language).rightAngelBracket();
|
buf.halfOpenElement("subject").xmllangAttribute(subject.language).rightAngleBracket();
|
||||||
buf.escape(subject.subject);
|
buf.escape(subject.subject);
|
||||||
buf.closeElement("subject");
|
buf.closeElement("subject");
|
||||||
}
|
}
|
||||||
|
@ -448,7 +448,7 @@ public class Message extends Packet {
|
||||||
// Skip the default language
|
// Skip the default language
|
||||||
if(body.equals(defaultBody))
|
if(body.equals(defaultBody))
|
||||||
continue;
|
continue;
|
||||||
buf.halfOpenElement(BODY).xmllangAttribute(body.getLanguage()).rightAngelBracket();
|
buf.halfOpenElement(BODY).xmllangAttribute(body.getLanguage()).rightAngleBracket();
|
||||||
buf.escape(body.getMessage());
|
buf.escape(body.getMessage());
|
||||||
buf.closeElement(BODY);
|
buf.closeElement(BODY);
|
||||||
}
|
}
|
||||||
|
|
|
@ -234,7 +234,7 @@ public class Presence extends Packet {
|
||||||
if (type != Type.available) {
|
if (type != Type.available) {
|
||||||
buf.attribute("type", type);
|
buf.attribute("type", type);
|
||||||
}
|
}
|
||||||
buf.rightAngelBracket();
|
buf.rightAngleBracket();
|
||||||
|
|
||||||
buf.optElement("status", status);
|
buf.optElement("status", status);
|
||||||
if (priority != Integer.MIN_VALUE) {
|
if (priority != Integer.MIN_VALUE) {
|
||||||
|
|
|
@ -92,7 +92,7 @@ public class Registration extends IQ {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder();
|
XmlStringBuilder xml = new XmlStringBuilder();
|
||||||
xml.halfOpenElement("query");
|
xml.halfOpenElement("query");
|
||||||
xml.xmlnsAttribute("jabber:iq:register");
|
xml.xmlnsAttribute("jabber:iq:register");
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
xml.optElement("instructions", instructions);
|
xml.optElement("instructions", instructions);
|
||||||
if (attributes != null && attributes.size() > 0) {
|
if (attributes != null && attributes.size() > 0) {
|
||||||
for (String name : attributes.keySet()) {
|
for (String name : attributes.keySet()) {
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class RosterPacket extends IQ {
|
||||||
buf.halfOpenElement("query");
|
buf.halfOpenElement("query");
|
||||||
buf.xmlnsAttribute("jabber:iq:roster");
|
buf.xmlnsAttribute("jabber:iq:roster");
|
||||||
buf.optAttribute("ver", rosterVersion);
|
buf.optAttribute("ver", rosterVersion);
|
||||||
buf.rightAngelBracket();
|
buf.rightAngleBracket();
|
||||||
|
|
||||||
synchronized (rosterItems) {
|
synchronized (rosterItems) {
|
||||||
for (Item entry : rosterItems) {
|
for (Item entry : rosterItems) {
|
||||||
|
@ -220,7 +220,7 @@ public class RosterPacket extends IQ {
|
||||||
xml.optAttribute("name", name);
|
xml.optAttribute("name", name);
|
||||||
xml.optAttribute("subscription", itemType);
|
xml.optAttribute("subscription", itemType);
|
||||||
xml.optAttribute("ask", itemStatus);
|
xml.optAttribute("ask", itemStatus);
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
|
|
||||||
for (String groupName : groupNames) {
|
for (String groupName : groupNames) {
|
||||||
xml.openElement(GROUP).escape(groupName).closeElement(GROUP);
|
xml.openElement(GROUP).escape(groupName).closeElement(GROUP);
|
||||||
|
|
|
@ -162,7 +162,7 @@ public class XMPPError {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder();
|
XmlStringBuilder xml = new XmlStringBuilder();
|
||||||
xml.halfOpenElement(ERROR);
|
xml.halfOpenElement(ERROR);
|
||||||
xml.optAttribute("type", type.name().toLowerCase(Locale.US));
|
xml.optAttribute("type", type.name().toLowerCase(Locale.US));
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
|
|
||||||
if (condition != null) {
|
if (condition != null) {
|
||||||
xml.halfOpenElement(condition);
|
xml.halfOpenElement(condition);
|
||||||
|
@ -173,7 +173,7 @@ public class XMPPError {
|
||||||
xml.halfOpenElement(Packet.TEXT);
|
xml.halfOpenElement(Packet.TEXT);
|
||||||
xml.xmllangAttribute("en");
|
xml.xmllangAttribute("en");
|
||||||
xml.xmlnsAttribute(NAMESPACE);
|
xml.xmlnsAttribute(NAMESPACE);
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
xml.escape(message);
|
xml.escape(message);
|
||||||
xml.closeElement(Packet.TEXT);
|
xml.closeElement(Packet.TEXT);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class SaslStanzas {
|
||||||
@Override
|
@Override
|
||||||
public XmlStringBuilder toXML() {
|
public XmlStringBuilder toXML() {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder();
|
XmlStringBuilder xml = new XmlStringBuilder();
|
||||||
xml.halfOpenElement(ELEMENT).xmlnsAttribute(NAMESPACE).attribute("mechanism", mechanism).rightAngelBracket();
|
xml.halfOpenElement(ELEMENT).xmlnsAttribute(NAMESPACE).attribute("mechanism", mechanism).rightAngleBracket();
|
||||||
xml.optAppend(authenticationText);
|
xml.optAppend(authenticationText);
|
||||||
xml.closeElement(ELEMENT);
|
xml.closeElement(ELEMENT);
|
||||||
return xml;
|
return xml;
|
||||||
|
@ -69,7 +69,7 @@ public class SaslStanzas {
|
||||||
@Override
|
@Override
|
||||||
public XmlStringBuilder toXML() {
|
public XmlStringBuilder toXML() {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder().halfOpenElement(ELEMENT).xmlnsAttribute(
|
XmlStringBuilder xml = new XmlStringBuilder().halfOpenElement(ELEMENT).xmlnsAttribute(
|
||||||
NAMESPACE).rightAngelBracket();
|
NAMESPACE).rightAngleBracket();
|
||||||
xml.optAppend(data);
|
xml.optAppend(data);
|
||||||
xml.closeElement(ELEMENT);
|
xml.closeElement(ELEMENT);
|
||||||
return xml;
|
return xml;
|
||||||
|
@ -95,7 +95,7 @@ public class SaslStanzas {
|
||||||
@Override
|
@Override
|
||||||
public XmlStringBuilder toXML() {
|
public XmlStringBuilder toXML() {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder();
|
XmlStringBuilder xml = new XmlStringBuilder();
|
||||||
xml.halfOpenElement(ELEMENT).xmlnsAttribute(NAMESPACE).rightAngelBracket();
|
xml.halfOpenElement(ELEMENT).xmlnsAttribute(NAMESPACE).rightAngleBracket();
|
||||||
xml.optAppend(authenticationText);
|
xml.optAppend(authenticationText);
|
||||||
xml.closeElement(ELEMENT);
|
xml.closeElement(ELEMENT);
|
||||||
return xml;
|
return xml;
|
||||||
|
@ -132,7 +132,7 @@ public class SaslStanzas {
|
||||||
@Override
|
@Override
|
||||||
public XmlStringBuilder toXML() {
|
public XmlStringBuilder toXML() {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder();
|
XmlStringBuilder xml = new XmlStringBuilder();
|
||||||
xml.halfOpenElement(ELEMENT).xmlnsAttribute(NAMESPACE).rightAngelBracket();
|
xml.halfOpenElement(ELEMENT).xmlnsAttribute(NAMESPACE).rightAngleBracket();
|
||||||
xml.optAppend(data);
|
xml.optAppend(data);
|
||||||
xml.closeElement(ELEMENT);
|
xml.closeElement(ELEMENT);
|
||||||
return xml;
|
return xml;
|
||||||
|
@ -180,7 +180,7 @@ public class SaslStanzas {
|
||||||
@Override
|
@Override
|
||||||
public XmlStringBuilder toXML() {
|
public XmlStringBuilder toXML() {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder();
|
XmlStringBuilder xml = new XmlStringBuilder();
|
||||||
xml.halfOpenElement(ELEMENT).xmlnsAttribute(ELEMENT).rightAngelBracket();
|
xml.halfOpenElement(ELEMENT).xmlnsAttribute(ELEMENT).rightAngleBracket();
|
||||||
xml.emptyElement(saslErrorString);
|
xml.emptyElement(saslErrorString);
|
||||||
xml.closeElement(ELEMENT);
|
xml.closeElement(ELEMENT);
|
||||||
return xml;
|
return xml;
|
||||||
|
|
|
@ -372,7 +372,7 @@ public class PacketParserUtils {
|
||||||
isEmptyElement = true;
|
isEmptyElement = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (event == XmlPullParser.END_TAG) {
|
else if (event == XmlPullParser.END_TAG) {
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.jivesoftware.smack.packet.Element;
|
||||||
import org.jivesoftware.smack.packet.PacketExtension;
|
import org.jivesoftware.smack.packet.PacketExtension;
|
||||||
|
|
||||||
public class XmlStringBuilder implements Appendable, CharSequence {
|
public class XmlStringBuilder implements Appendable, CharSequence {
|
||||||
public static final String RIGHT_ANGEL_BRACKET = Character.toString('>');
|
public static final String RIGHT_ANGLE_BRACKET = Character.toString('>');
|
||||||
|
|
||||||
private final LazyStringBuilder sb;
|
private final LazyStringBuilder sb;
|
||||||
|
|
||||||
|
@ -86,13 +86,13 @@ public class XmlStringBuilder implements Appendable, CharSequence {
|
||||||
}
|
}
|
||||||
|
|
||||||
public XmlStringBuilder openElement(String name) {
|
public XmlStringBuilder openElement(String name) {
|
||||||
halfOpenElement(name).rightAngelBracket();
|
halfOpenElement(name).rightAngleBracket();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public XmlStringBuilder closeElement(String name) {
|
public XmlStringBuilder closeElement(String name) {
|
||||||
sb.append("</").append(name);
|
sb.append("</").append(name);
|
||||||
rightAngelBracket();
|
rightAngleBracket();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,11 +106,26 @@ public class XmlStringBuilder implements Appendable, CharSequence {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public XmlStringBuilder rightAngelBracket() {
|
/**
|
||||||
sb.append(RIGHT_ANGEL_BRACKET);
|
* Add a right angle bracket '>'
|
||||||
|
*
|
||||||
|
* @return a reference to this object.
|
||||||
|
*/
|
||||||
|
public XmlStringBuilder rightAngleBracket() {
|
||||||
|
sb.append(RIGHT_ANGLE_BRACKET);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return a reference to this object
|
||||||
|
* @deprecated use {@link #rightAngleBracket()} instead
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public XmlStringBuilder rightAngelBracket() {
|
||||||
|
return rightAngleBracket();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does nothing if value is null.
|
* Does nothing if value is null.
|
||||||
*
|
*
|
||||||
|
|
|
@ -80,7 +80,7 @@ public class CarbonExtension implements PacketExtension {
|
||||||
@Override
|
@Override
|
||||||
public XmlStringBuilder toXML() {
|
public XmlStringBuilder toXML() {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
xml.append(fwd.toXML());
|
xml.append(fwd.toXML());
|
||||||
xml.closeElement(this);
|
xml.closeElement(this);
|
||||||
return xml;
|
return xml;
|
||||||
|
|
|
@ -169,7 +169,7 @@ public class Bookmarks implements PrivateData {
|
||||||
@Override
|
@Override
|
||||||
public XmlStringBuilder toXML() {
|
public XmlStringBuilder toXML() {
|
||||||
XmlStringBuilder buf = new XmlStringBuilder();
|
XmlStringBuilder buf = new XmlStringBuilder();
|
||||||
buf.halfOpenElement(ELEMENT).xmlnsAttribute(NAMESPACE).rightAngelBracket();
|
buf.halfOpenElement(ELEMENT).xmlnsAttribute(NAMESPACE).rightAngleBracket();
|
||||||
|
|
||||||
for (BookmarkedURL urlStorage : getBookmarkedURLS()) {
|
for (BookmarkedURL urlStorage : getBookmarkedURLS()) {
|
||||||
if(urlStorage.isShared()) {
|
if(urlStorage.isShared()) {
|
||||||
|
@ -189,7 +189,7 @@ public class Bookmarks implements PrivateData {
|
||||||
buf.attribute("name", conference.getName());
|
buf.attribute("name", conference.getName());
|
||||||
buf.attribute("autojoin", Boolean.toString(conference.isAutoJoin()));
|
buf.attribute("autojoin", Boolean.toString(conference.isAutoJoin()));
|
||||||
buf.attribute("jid", conference.getJid());
|
buf.attribute("jid", conference.getJid());
|
||||||
buf.rightAngelBracket();
|
buf.rightAngleBracket();
|
||||||
|
|
||||||
buf.optElement("nick", conference.getNickname());
|
buf.optElement("nick", conference.getNickname());
|
||||||
buf.optElement("password", conference.getPassword());
|
buf.optElement("password", conference.getPassword());
|
||||||
|
|
|
@ -138,7 +138,7 @@ public class DataPacketExtension implements PacketExtension {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||||
xml.attribute("seq", Long.toString(seq));
|
xml.attribute("seq", Long.toString(seq));
|
||||||
xml.attribute("sid", sessionID);
|
xml.attribute("sid", sessionID);
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
xml.append(data);
|
xml.append(data);
|
||||||
xml.closeElement(this);
|
xml.closeElement(this);
|
||||||
return xml;
|
return xml;
|
||||||
|
|
|
@ -224,7 +224,7 @@ public class Bytestream extends IQ {
|
||||||
case set:
|
case set:
|
||||||
xml.optAttribute("sid", getSessionID());
|
xml.optAttribute("sid", getSessionID());
|
||||||
xml.optAttribute("mode", getMode());
|
xml.optAttribute("mode", getMode());
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
if (getToActivate() == null) {
|
if (getToActivate() == null) {
|
||||||
for (StreamHost streamHost : getStreamHosts()) {
|
for (StreamHost streamHost : getStreamHosts()) {
|
||||||
xml.append(streamHost.toXML());
|
xml.append(streamHost.toXML());
|
||||||
|
@ -235,7 +235,7 @@ public class Bytestream extends IQ {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case result:
|
case result:
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
if (getUsedHost() != null) {
|
if (getUsedHost() != null) {
|
||||||
xml.append(getUsedHost().toXML());
|
xml.append(getUsedHost().toXML());
|
||||||
}
|
}
|
||||||
|
@ -416,7 +416,7 @@ public class Bytestream extends IQ {
|
||||||
@Override
|
@Override
|
||||||
public XmlStringBuilder toXML() {
|
public XmlStringBuilder toXML() {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
xml.escape(getTarget());
|
xml.escape(getTarget());
|
||||||
xml.closeElement(this);
|
xml.closeElement(this);
|
||||||
return xml;
|
return xml;
|
||||||
|
|
|
@ -101,7 +101,7 @@ public class DelayInformation implements PacketExtension {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||||
xml.attribute("stamp", XmppDateTime.formatXEP0082Date(stamp));
|
xml.attribute("stamp", XmppDateTime.formatXEP0082Date(stamp));
|
||||||
xml.optAttribute("from", from);
|
xml.optAttribute("from", from);
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
xml.optAppend(reason);
|
xml.optAppend(reason);
|
||||||
xml.closeElement(this);
|
xml.closeElement(this);
|
||||||
return xml;
|
return xml;
|
||||||
|
|
|
@ -175,7 +175,7 @@ public class DiscoverInfo extends IQ implements Cloneable {
|
||||||
xml.halfOpenElement("query");
|
xml.halfOpenElement("query");
|
||||||
xml.xmlnsAttribute(NAMESPACE);
|
xml.xmlnsAttribute(NAMESPACE);
|
||||||
xml.optAttribute("node", getNode());
|
xml.optAttribute("node", getNode());
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
for (Identity identity : identities) {
|
for (Identity identity : identities) {
|
||||||
xml.append(identity.toXML());
|
xml.append(identity.toXML());
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,7 @@ public class DiscoverItems extends IQ {
|
||||||
xml.halfOpenElement("query");
|
xml.halfOpenElement("query");
|
||||||
xml.xmlnsAttribute(NAMESPACE);
|
xml.xmlnsAttribute(NAMESPACE);
|
||||||
xml.optAttribute("node", getNode());
|
xml.optAttribute("node", getNode());
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
|
|
||||||
for (Item item : items) {
|
for (Item item : items) {
|
||||||
xml.append(item.toXML());
|
xml.append(item.toXML());
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class Forwarded implements PacketExtension {
|
||||||
@Override
|
@Override
|
||||||
public XmlStringBuilder toXML() {
|
public XmlStringBuilder toXML() {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
xml.optElement(getDelayInformation());
|
xml.optElement(getDelayInformation());
|
||||||
xml.append(forwardedPacket.toXML());
|
xml.append(forwardedPacket.toXML());
|
||||||
xml.closeElement(this);
|
xml.closeElement(this);
|
||||||
|
|
|
@ -143,7 +143,7 @@ public class Version extends IQ {
|
||||||
@Override
|
@Override
|
||||||
public XmlStringBuilder getChildElementXML() {
|
public XmlStringBuilder getChildElementXML() {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder();
|
XmlStringBuilder xml = new XmlStringBuilder();
|
||||||
xml.halfOpenElement(IQ.QUERY_ELEMENT).xmlnsAttribute(NAMESPACE).rightAngelBracket();
|
xml.halfOpenElement(IQ.QUERY_ELEMENT).xmlnsAttribute(NAMESPACE).rightAngleBracket();
|
||||||
// Although not really optional elements, 'name' and 'version' are not set when sending a
|
// Although not really optional elements, 'name' and 'version' are not set when sending a
|
||||||
// version request. So we must handle the case that those are 'null' here.
|
// version request. So we must handle the case that those are 'null' here.
|
||||||
xml.optElement("name", name);
|
xml.optElement("name", name);
|
||||||
|
|
|
@ -137,7 +137,7 @@ public class JivePropertiesExtension implements PacketExtension {
|
||||||
@Override
|
@Override
|
||||||
public CharSequence toXML() {
|
public CharSequence toXML() {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
// Loop through all properties and write them out.
|
// Loop through all properties and write them out.
|
||||||
for (String name : getPropertyNames()) {
|
for (String name : getPropertyNames()) {
|
||||||
Object value = getProperty(name);
|
Object value = getProperty(name);
|
||||||
|
@ -209,7 +209,7 @@ public class JivePropertiesExtension implements PacketExtension {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xml.attribute("type", type);
|
xml.attribute("type", type);
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
xml.escape(valueStr);
|
xml.escape(valueStr);
|
||||||
xml.closeElement("value");
|
xml.closeElement("value");
|
||||||
xml.closeElement("property");
|
xml.closeElement("property");
|
||||||
|
|
|
@ -72,7 +72,7 @@ public class Destroy implements Element {
|
||||||
public XmlStringBuilder toXML() {
|
public XmlStringBuilder toXML() {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||||
xml.optAttribute("jid", getJid());
|
xml.optAttribute("jid", getJid());
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
xml.optElement("reason", getReason());
|
xml.optElement("reason", getReason());
|
||||||
xml.closeElement(this);
|
xml.closeElement(this);
|
||||||
return xml;
|
return xml;
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class MUCAdmin extends IQ {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder();
|
XmlStringBuilder xml = new XmlStringBuilder();
|
||||||
xml.halfOpenElement(IQ.QUERY_ELEMENT);
|
xml.halfOpenElement(IQ.QUERY_ELEMENT);
|
||||||
xml.xmlnsAttribute(NAMESPACE);
|
xml.xmlnsAttribute(NAMESPACE);
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
synchronized (items) {
|
synchronized (items) {
|
||||||
for (MUCItem item : items) {
|
for (MUCItem item : items) {
|
||||||
xml.append(item.toXML());
|
xml.append(item.toXML());
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class MUCInitialPresence implements PacketExtension {
|
||||||
@Override
|
@Override
|
||||||
public XmlStringBuilder toXML() {
|
public XmlStringBuilder toXML() {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
xml.optElement("password", getPassword());
|
xml.optElement("password", getPassword());
|
||||||
xml.optElement(getHistory());
|
xml.optElement(getHistory());
|
||||||
xml.closeElement(this);
|
xml.closeElement(this);
|
||||||
|
|
|
@ -173,7 +173,7 @@ public class MUCItem implements Element {
|
||||||
xml.optAttribute("jid", getJid());
|
xml.optAttribute("jid", getJid());
|
||||||
xml.optAttribute("nick", getNick());
|
xml.optAttribute("nick", getNick());
|
||||||
xml.optAttribute("role", getRole());
|
xml.optAttribute("role", getRole());
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
xml.optElement("reason", getReason());
|
xml.optElement("reason", getReason());
|
||||||
if (getActor() != null) {
|
if (getActor() != null) {
|
||||||
xml.halfOpenElement("actor").attribute("jid", getActor()).closeEmptyElement();
|
xml.halfOpenElement("actor").attribute("jid", getActor()).closeEmptyElement();
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class MUCOwner extends IQ {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder();
|
XmlStringBuilder xml = new XmlStringBuilder();
|
||||||
xml.halfOpenElement(IQ.QUERY_ELEMENT);
|
xml.halfOpenElement(IQ.QUERY_ELEMENT);
|
||||||
xml.xmlnsAttribute(NAMESPACE);
|
xml.xmlnsAttribute(NAMESPACE);
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
synchronized (items) {
|
synchronized (items) {
|
||||||
for (MUCItem item : items) {
|
for (MUCItem item : items) {
|
||||||
xml.append(item.toXML());
|
xml.append(item.toXML());
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class MUCUser implements PacketExtension {
|
||||||
@Override
|
@Override
|
||||||
public XmlStringBuilder toXML() {
|
public XmlStringBuilder toXML() {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
xml.optElement(getInvite());
|
xml.optElement(getInvite());
|
||||||
xml.optElement(getDecline());
|
xml.optElement(getDecline());
|
||||||
xml.optElement(getItem());
|
xml.optElement(getItem());
|
||||||
|
@ -268,7 +268,7 @@ public class MUCUser implements PacketExtension {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||||
xml.optAttribute("to", getTo());
|
xml.optAttribute("to", getTo());
|
||||||
xml.optAttribute("from", getFrom());
|
xml.optAttribute("from", getFrom());
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
xml.optElement("reason", getReason());
|
xml.optElement("reason", getReason());
|
||||||
xml.closeElement(this);
|
xml.closeElement(this);
|
||||||
return xml;
|
return xml;
|
||||||
|
@ -354,7 +354,7 @@ public class MUCUser implements PacketExtension {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||||
xml.optAttribute("to", getTo());
|
xml.optAttribute("to", getTo());
|
||||||
xml.optAttribute("from", getFrom());
|
xml.optAttribute("from", getFrom());
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
xml.optElement("reason", getReason());
|
xml.optElement("reason", getReason());
|
||||||
xml.closeElement(this);
|
xml.closeElement(this);
|
||||||
return xml;
|
return xml;
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class UserSearch extends IQ {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder();
|
XmlStringBuilder xml = new XmlStringBuilder();
|
||||||
xml.halfOpenElement(IQ.QUERY_ELEMENT);
|
xml.halfOpenElement(IQ.QUERY_ELEMENT);
|
||||||
xml.xmlnsAttribute(NAMESPACE);
|
xml.xmlnsAttribute(NAMESPACE);
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
xml.append(getExtensionsXML());
|
xml.append(getExtensionsXML());
|
||||||
xml.closeElement(IQ.QUERY_ELEMENT);
|
xml.closeElement(IQ.QUERY_ELEMENT);
|
||||||
return xml;
|
return xml;
|
||||||
|
|
|
@ -271,7 +271,7 @@ public class FormField {
|
||||||
buf.optAttribute("label", getLabel());
|
buf.optAttribute("label", getLabel());
|
||||||
buf.optAttribute("var", getVariable());
|
buf.optAttribute("var", getVariable());
|
||||||
buf.optAttribute("type", getType());
|
buf.optAttribute("type", getType());
|
||||||
buf.rightAngelBracket();
|
buf.rightAngleBracket();
|
||||||
// Add elements
|
// Add elements
|
||||||
buf.optElement("desc", getDescription());
|
buf.optElement("desc", getDescription());
|
||||||
buf.condEmptyElement(isRequired(), "required");
|
buf.condEmptyElement(isRequired(), "required");
|
||||||
|
@ -355,7 +355,7 @@ public class FormField {
|
||||||
xml.halfOpenElement(ELEMENT);
|
xml.halfOpenElement(ELEMENT);
|
||||||
// Add attribute
|
// Add attribute
|
||||||
xml.optAttribute("label", getLabel());
|
xml.optAttribute("label", getLabel());
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
|
|
||||||
// Add element
|
// Add element
|
||||||
xml.element("value", getValue());
|
xml.element("value", getValue());
|
||||||
|
|
|
@ -214,7 +214,7 @@ public class DataForm implements PacketExtension {
|
||||||
public XmlStringBuilder toXML() {
|
public XmlStringBuilder toXML() {
|
||||||
XmlStringBuilder buf = new XmlStringBuilder(this);
|
XmlStringBuilder buf = new XmlStringBuilder(this);
|
||||||
buf.attribute("type", getType());
|
buf.attribute("type", getType());
|
||||||
buf.rightAngelBracket();
|
buf.rightAngleBracket();
|
||||||
|
|
||||||
buf.optElement("title", getTitle());
|
buf.optElement("title", getTitle());
|
||||||
for (String instruction : getInstructions()) {
|
for (String instruction : getInstructions()) {
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class XHTMLText {
|
||||||
text.halfOpenElement(A);
|
text.halfOpenElement(A);
|
||||||
text.optAttribute(HREF, href);
|
text.optAttribute(HREF, href);
|
||||||
text.optAttribute(STYLE, style);
|
text.optAttribute(STYLE, style);
|
||||||
text.rightAngelBracket();
|
text.rightAngleBracket();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ public class XHTMLText {
|
||||||
public XHTMLText appendOpenBlockQuoteTag(String style) {
|
public XHTMLText appendOpenBlockQuoteTag(String style) {
|
||||||
text.halfOpenElement(BLOCKQUOTE);
|
text.halfOpenElement(BLOCKQUOTE);
|
||||||
text.optAttribute(STYLE, style);
|
text.optAttribute(STYLE, style);
|
||||||
text.rightAngelBracket();
|
text.rightAngleBracket();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ public class XHTMLText {
|
||||||
text.xmlnsAttribute(NAMESPACE);
|
text.xmlnsAttribute(NAMESPACE);
|
||||||
text.optElement(STYLE, style);
|
text.optElement(STYLE, style);
|
||||||
text.xmllangAttribute(lang);
|
text.xmllangAttribute(lang);
|
||||||
text.rightAngelBracket();
|
text.rightAngleBracket();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ public class XHTMLText {
|
||||||
}
|
}
|
||||||
text.halfOpenElement(H + Integer.toString(level));
|
text.halfOpenElement(H + Integer.toString(level));
|
||||||
text.optAttribute(STYLE, style);
|
text.optAttribute(STYLE, style);
|
||||||
text.rightAngelBracket();
|
text.rightAngleBracket();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ public class XHTMLText {
|
||||||
text.optAttribute("height", height);
|
text.optAttribute("height", height);
|
||||||
text.optAttribute("src", src);
|
text.optAttribute("src", src);
|
||||||
text.optAttribute("width", width);
|
text.optAttribute("width", width);
|
||||||
text.rightAngelBracket();
|
text.rightAngleBracket();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ public class XHTMLText {
|
||||||
public XHTMLText appendLineItemTag(String style) {
|
public XHTMLText appendLineItemTag(String style) {
|
||||||
text.halfOpenElement(LI);
|
text.halfOpenElement(LI);
|
||||||
text.optAttribute(STYLE, style);
|
text.optAttribute(STYLE, style);
|
||||||
text.rightAngelBracket();
|
text.rightAngleBracket();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ public class XHTMLText {
|
||||||
public XHTMLText appendOpenOrderedListTag(String style) {
|
public XHTMLText appendOpenOrderedListTag(String style) {
|
||||||
text.halfOpenElement(OL);
|
text.halfOpenElement(OL);
|
||||||
text.optAttribute(STYLE, style);
|
text.optAttribute(STYLE, style);
|
||||||
text.rightAngelBracket();
|
text.rightAngleBracket();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,7 +272,7 @@ public class XHTMLText {
|
||||||
public XHTMLText appendOpenUnorderedListTag(String style) {
|
public XHTMLText appendOpenUnorderedListTag(String style) {
|
||||||
text.halfOpenElement(UL);
|
text.halfOpenElement(UL);
|
||||||
text.optAttribute(STYLE, style);
|
text.optAttribute(STYLE, style);
|
||||||
text.rightAngelBracket();
|
text.rightAngleBracket();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -296,7 +296,7 @@ public class XHTMLText {
|
||||||
public XHTMLText appendOpenParagraphTag(String style) {
|
public XHTMLText appendOpenParagraphTag(String style) {
|
||||||
text.halfOpenElement(P);
|
text.halfOpenElement(P);
|
||||||
text.optAttribute(STYLE, style);
|
text.optAttribute(STYLE, style);
|
||||||
text.rightAngelBracket();
|
text.rightAngleBracket();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,7 +320,7 @@ public class XHTMLText {
|
||||||
public XHTMLText appendOpenInlinedQuoteTag(String style) {
|
public XHTMLText appendOpenInlinedQuoteTag(String style) {
|
||||||
text.halfOpenElement(Q);
|
text.halfOpenElement(Q);
|
||||||
text.optAttribute(STYLE, style);
|
text.optAttribute(STYLE, style);
|
||||||
text.rightAngelBracket();
|
text.rightAngleBracket();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,7 +343,7 @@ public class XHTMLText {
|
||||||
public XHTMLText appendOpenSpanTag(String style) {
|
public XHTMLText appendOpenSpanTag(String style) {
|
||||||
text.halfOpenElement(SPAN);
|
text.halfOpenElement(SPAN);
|
||||||
text.optAttribute(STYLE, style);
|
text.optAttribute(STYLE, style);
|
||||||
text.rightAngelBracket();
|
text.rightAngleBracket();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ public class XHTMLExtension implements PacketExtension {
|
||||||
@Override
|
@Override
|
||||||
public XmlStringBuilder toXML() {
|
public XmlStringBuilder toXML() {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||||
xml.rightAngelBracket();
|
xml.rightAngleBracket();
|
||||||
// Loop through all the bodies and append them to the string buffer
|
// Loop through all the bodies and append them to the string buffer
|
||||||
for (CharSequence body : getBodies()) {
|
for (CharSequence body : getBodies()) {
|
||||||
xml.append(body);
|
xml.append(body);
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class DataTest {
|
||||||
dataTag.xmlnsAttribute(DataPacketExtension.NAMESPACE);
|
dataTag.xmlnsAttribute(DataPacketExtension.NAMESPACE);
|
||||||
dataTag.attribute("seq", "0");
|
dataTag.attribute("seq", "0");
|
||||||
dataTag.attribute("sid", "i781hf64");
|
dataTag.attribute("sid", "i781hf64");
|
||||||
dataTag.rightAngelBracket();
|
dataTag.rightAngleBracket();
|
||||||
dataTag.escape(encodedData);
|
dataTag.escape(encodedData);
|
||||||
dataTag.closeElement(DataPacketExtension.ELEMENT);
|
dataTag.closeElement(DataPacketExtension.ELEMENT);
|
||||||
when(dpe.toXML()).thenReturn(dataTag);
|
when(dpe.toXML()).thenReturn(dataTag);
|
||||||
|
|
Loading…
Reference in a new issue