mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 00:59:39 +02:00
Rework XML Element hierarchy and XmlStringBuilder
- Reduce the amount of types that are subtypes of NamedElement. See javadoc of NamedElement for rationale. - Work more with XmlEnvironment in XmlStringBuilder. - Some minor changes to XmlStringBuilder API.
This commit is contained in:
parent
e9bcdf3e6d
commit
65576cf3c2
74 changed files with 653 additions and 523 deletions
|
@ -24,8 +24,8 @@ import java.util.Locale;
|
|||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.packet.NamedElement;
|
||||
import org.jivesoftware.smack.packet.Stanza;
|
||||
import org.jivesoftware.smack.util.EqualsUtil;
|
||||
import org.jivesoftware.smack.util.HashCode;
|
||||
|
@ -112,7 +112,7 @@ public final class RosterPacket extends IQ {
|
|||
* the groups the roster item belongs to.
|
||||
*/
|
||||
// TODO Make this class immutable.
|
||||
public static final class Item implements NamedElement {
|
||||
public static final class Item implements ExtensionElement {
|
||||
|
||||
/**
|
||||
* The constant value "{@value}".
|
||||
|
@ -163,6 +163,11 @@ public final class RosterPacket extends IQ {
|
|||
return ELEMENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
return NAMESPACE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the user.
|
||||
*
|
||||
|
@ -275,7 +280,7 @@ public final class RosterPacket extends IQ {
|
|||
|
||||
@Override
|
||||
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||
XmlStringBuilder xml = new XmlStringBuilder(this, enclosingNamespace);
|
||||
xml.attribute("jid", jid);
|
||||
xml.optAttribute("name", name);
|
||||
xml.optAttribute("subscription", itemType);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue