mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 18:59:41 +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:
parent
06add179ec
commit
f2703bc195
7 changed files with 164 additions and 123 deletions
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue