use of org.jivesoftware.smack.util.XmlStringBuilder in project Smack by igniterealtime.
the class MUCUser method toXML.
@Override
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
XmlStringBuilder xml = new XmlStringBuilder(this);
xml.rightAngleBracket();
xml.optElement(getInvite());
xml.optElement(getDecline());
xml.optElement(getItem());
xml.optElement("password", getPassword());
xml.append(statusCodes);
xml.optElement(getDestroy());
xml.closeElement(this);
return xml;
}
use of org.jivesoftware.smack.util.XmlStringBuilder in project Smack by igniterealtime.
the class NodeExtension method toXML.
@Override
public final XmlStringBuilder toXML(XmlEnvironment enclosingNamespace) {
XmlStringBuilder xml = new XmlStringBuilder(this, enclosingNamespace);
xml.optAttribute("node", node);
addXml(xml);
return xml;
}
use of org.jivesoftware.smack.util.XmlStringBuilder in project Smack by igniterealtime.
the class Nick method toXML.
@Override
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
XmlStringBuilder xml = new XmlStringBuilder(this, enclosingNamespace);
xml.rightAngleBracket();
xml.escape(getName());
xml.closeElement(this);
return xml;
}
use of org.jivesoftware.smack.util.XmlStringBuilder in project Smack by igniterealtime.
the class UserTuneElement method toXML.
@Override
public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) {
XmlStringBuilder xml = new XmlStringBuilder(this);
if (isEmptyUserTune()) {
return xml.closeEmptyElement();
}
xml.rightAngleBracket();
xml.optElement("artist", artist);
xml.optElement("length", length);
xml.optElement("rating", rating);
xml.optElement("source", source);
xml.optElement("title", title);
xml.optElement("track", track);
xml.optElement("uri", uri);
return xml.closeElement(getElementName());
}
use of org.jivesoftware.smack.util.XmlStringBuilder in project Smack by igniterealtime.
the class FormField method toXML.
public final XmlStringBuilder toXML(XmlEnvironment enclosingNamespace, boolean includeType) {
XmlStringBuilder buf = new XmlStringBuilder(this, enclosingNamespace);
// Add attributes
buf.optAttribute("label", getLabel());
buf.optAttribute("var", getFieldName());
if (includeType) {
// If no 'type' is specified, the default is "text-single";
buf.attribute("type", getType(), Type.text_single);
}
if (extraXmlChildElements == null) {
// If extraXmlChildElements is null, see if they should be populated.
populateExtraXmlChildElements();
}
if (formFieldChildElements.isEmpty() && (extraXmlChildElements == null || extraXmlChildElements.isEmpty())) {
buf.closeEmptyElement();
} else {
buf.rightAngleBracket();
buf.optAppend(extraXmlChildElements);
buf.append(formFieldChildElements);
buf.closeElement(this);
}
return buf;
}
Aggregations