mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 01:29:38 +02:00
Rework smackx.address (XEP-0033: Extended Stanza Addressing)
- Make MultipleAddress.Type a enum - Change the signature of the methods to use Collection instead of List - Use for-each loops instead of iterators - Switch Provider to new provider pattern (using switch-case) - Use XmlStringBuilder (extend the API by two new methods)
This commit is contained in:
parent
36da216b4a
commit
fe74fc23dc
5 changed files with 108 additions and 109 deletions
|
@ -98,6 +98,10 @@ public class XmlStringBuilder implements Appendable, CharSequence {
|
|||
return this;
|
||||
}
|
||||
|
||||
public XmlStringBuilder halfOpenElement(NamedElement namedElement) {
|
||||
return halfOpenElement(namedElement.getElementName());
|
||||
}
|
||||
|
||||
public XmlStringBuilder openElement(String name) {
|
||||
halfOpenElement(name).rightAngleBracket();
|
||||
return this;
|
||||
|
@ -207,6 +211,13 @@ public class XmlStringBuilder implements Appendable, CharSequence {
|
|||
return this;
|
||||
}
|
||||
|
||||
public XmlStringBuilder optBooleanAttribute(String name, boolean bool) {
|
||||
if (bool) {
|
||||
sb.append(' ').append(name).append("='true'");
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public XmlStringBuilder xmlnsAttribute(String value) {
|
||||
optAttribute("xmlns", value);
|
||||
return this;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue