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

Improve SHIM API

- HeadersExtension.getHeaders() now returns a List instead of a
  Collection
- Use XmlStringBuilder in Header and HeadersExtension toXML()
- Add HeadersProviderTest
- Use Smack formatting

Also remove duplicate parsing code regarding SHIM from HOXT
implementation.
This commit is contained in:
Florian Schmaus 2015-01-01 23:57:44 +01:00
parent 06add179ec
commit f2703bc195
7 changed files with 164 additions and 123 deletions

View file

@ -16,6 +16,8 @@
*/
package org.jivesoftware.smack.util;
import java.util.Collection;
import org.jivesoftware.smack.packet.Element;
import org.jivesoftware.smack.packet.NamedElement;
import org.jivesoftware.smack.packet.PacketExtension;
@ -272,6 +274,13 @@ public class XmlStringBuilder implements Appendable, CharSequence {
return this;
}
public XmlStringBuilder append(Collection<? extends Element> elements) {
for (Element element : elements) {
append(element.toXML());
}
return this;
}
public XmlStringBuilder emptyElement(Enum<?> element) {
return emptyElement(element.name());
}