use of org.jivesoftware.smack.util.XmlStringBuilder in project Smack by igniterealtime.
the class Header method toXML.
@Override
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
// Upcast to NamedElement since we don't want a xmlns attribute
XmlStringBuilder xml = new XmlStringBuilder((NamedElement) this);
xml.attribute("name", name);
xml.rightAngleBracket();
xml.escape(value);
xml.closeElement(this);
return xml;
}
use of org.jivesoftware.smack.util.XmlStringBuilder in project Smack by igniterealtime.
the class HeadersExtension method toXML.
@Override
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
XmlStringBuilder xml = new XmlStringBuilder(this);
xml.rightAngleBracket();
xml.append(headers);
xml.closeElement(this);
return xml;
}
use of org.jivesoftware.smack.util.XmlStringBuilder in project Smack by igniterealtime.
the class ValidateElement method toXML.
@Override
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
XmlStringBuilder buf = new XmlStringBuilder(this, enclosingNamespace);
buf.optAttribute("datatype", datatype);
buf.rightAngleBracket();
appendXML(buf);
buf.optAppend(getListRange());
buf.closeElement(this);
return buf;
}
use of org.jivesoftware.smack.util.XmlStringBuilder in project Smack by igniterealtime.
the class DataForm method toXML.
@Override
public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) {
XmlStringBuilder buf = new XmlStringBuilder(this, xmlEnvironment);
buf.attribute("type", getType());
buf.rightAngleBracket();
xmlEnvironment = buf.getXmlEnvironment();
buf.optElement("title", getTitle());
for (String instruction : getInstructions()) {
buf.element("instructions", instruction);
}
// Append the list of fields returned from a search
buf.optElement(getReportedData());
// Loop through all the items returned from a search and append them to the string buffer
buf.append(getItems());
// Add all form fields.
// We do not need to include the type for data forms of the type submit.
boolean includeType = getType() != Type.submit;
for (FormField formField : getFields()) {
buf.append(formField.toXML(xmlEnvironment, includeType));
}
buf.append(getExtensionElements());
buf.closeElement(this);
return buf;
}
use of org.jivesoftware.smack.util.XmlStringBuilder in project Smack by igniterealtime.
the class DataLayout method toXML.
/*
* (non-Javadoc)
* @see org.jivesoftware.smack.packet.PacketExtension#toXML()
*/
@Override
public XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
XmlStringBuilder buf = new XmlStringBuilder(this);
buf.optAttribute("label", getLabel());
buf.rightAngleBracket();
buf.append(getPageLayout());
buf.closeElement(this);
return buf;
}
Aggregations