public XmlStringBuilder toXML() {
   XmlStringBuilder xmlstringbuilder = new XmlStringBuilder();
   xmlstringbuilder.halfOpenElement(getElementName());
   xmlstringbuilder.attribute("node", getNode());
   xmlstringbuilder.optAttribute("subid", getSubscriptionId());
   xmlstringbuilder.optIntAttribute("max_items", getMaxItems());
   xmlstringbuilder.closeEmptyElement();
   return xmlstringbuilder;
 }
Beispiel #2
0
 @Override
 public XmlStringBuilder toXML() {
   XmlStringBuilder xml = new XmlStringBuilder(this);
   xml.attribute("stamp", XmppDateTime.formatXEP0082Date(stamp));
   xml.optAttribute("from", from);
   xml.rightAngleBracket();
   xml.optAppend(reason);
   xml.closeElement(this);
   return xml;
 }
Beispiel #3
0
 public XmlStringBuilder toXML() {
   XmlStringBuilder xml = new XmlStringBuilder();
   xml.halfOpenElement("identity");
   xml.xmllangAttribute(lang);
   xml.attribute("category", category);
   xml.optAttribute("name", name);
   xml.optAttribute("type", type);
   xml.closeEmptyElement();
   return xml;
 }
Beispiel #4
0
 public XmlStringBuilder toXML() {
   XmlStringBuilder xmlStringBuilder = new XmlStringBuilder();
   xmlStringBuilder.halfOpenElement(ERROR);
   xmlStringBuilder.attribute("type", this.type.toString());
   xmlStringBuilder.optAttribute("by", this.errorGenerator);
   xmlStringBuilder.rightAngleBracket();
   xmlStringBuilder.halfOpenElement(this.condition.toString());
   xmlStringBuilder.xmlnsAttribute(NAMESPACE);
   if (this.conditionText != null) {
     xmlStringBuilder.rightAngleBracket();
     xmlStringBuilder.escape(this.conditionText);
     xmlStringBuilder.closeElement(this.condition.toString());
   } else {
     xmlStringBuilder.closeEmptyElement();
   }
   addDescriptiveTextsAndExtensions(xmlStringBuilder);
   xmlStringBuilder.closeElement(ERROR);
   return xmlStringBuilder;
 }
Beispiel #5
0
 public XmlStringBuilder xmllangAttribute(String value) {
   optAttribute("xml:lang", value);
   return this;
 }
Beispiel #6
0
 public XmlStringBuilder xmlnsAttribute(String value) {
   optAttribute("xmlns", value);
   return this;
 }
Beispiel #7
0
 /**
  * Add to, from, id and 'xml:lang' attributes
  *
  * @param xml
  */
 protected void addCommonAttributes(XmlStringBuilder xml) {
   xml.optAttribute("to", getTo());
   xml.optAttribute("from", getFrom());
   xml.optAttribute("id", getStanzaId());
   xml.xmllangAttribute(getLanguage());
 }