public XmlStringBuilder toXML()
 {
     XmlStringBuilder xmlstringbuilder = new XmlStringBuilder(this);
     xmlstringbuilder.rightAngleBracket();
     for (Iterator iterator = getBodies().iterator(); iterator.hasNext(); xmlstringbuilder.append((CharSequence)iterator.next())) { }
     xmlstringbuilder.closeElement(this);
     return xmlstringbuilder;
 }
Exemple #2
0
 @Override
 public XmlStringBuilder toXML() {
   XmlStringBuilder xml = new XmlStringBuilder(this);
   xml.rightAngleBracket();
   xml.append(fwd.toXML());
   xml.closeElement(this);
   return xml;
 }
 public final XmlStringBuilder toXML() {
   XmlStringBuilder xml = new XmlStringBuilder((PacketExtension) this);
   xml.attribute("seq", Long.toString(this.seq));
   xml.attribute("sid", this.sessionID);
   xml.rightAngleBracket();
   xml.append(this.data);
   xml.closeElement((NamedElement) this);
   return xml;
 }
 @Override
 public XmlStringBuilder toXML() {
   XmlStringBuilder xml = new XmlStringBuilder(this);
   xml.rightAngleBracket();
   xml.optElement("password", getPassword());
   xml.optElement(getHistory());
   xml.closeElement(this);
   return xml;
 }
Exemple #5
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;
 }
Exemple #6
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;
 }
Exemple #7
0
 private static CharSequence parseContentDepthWithoutRoundtrip(
     XmlPullParser xmlPullParser, int i, boolean z) throws XmlPullParserException, IOException {
   XmlStringBuilder xmlStringBuilder = new XmlStringBuilder();
   Object obj = null;
   int eventType = xmlPullParser.getEventType();
   String str = null;
   while (true) {
     Object obj2;
     switch (eventType) {
       case VideoSize.HVGA /*2*/:
         xmlStringBuilder.halfOpenElement(xmlPullParser.getName());
         if (str == null || z) {
           String namespace = xmlPullParser.getNamespace();
           if (StringUtils.isNotEmpty(namespace)) {
             xmlStringBuilder.attribute("xmlns", namespace);
             str = xmlPullParser.getName();
           }
         }
         for (eventType = 0; eventType < xmlPullParser.getAttributeCount(); eventType++) {
           xmlStringBuilder.attribute(
               xmlPullParser.getAttributeName(eventType),
               xmlPullParser.getAttributeValue(eventType));
         }
         if (!xmlPullParser.isEmptyElementTag()) {
           xmlStringBuilder.rightAngleBracket();
           obj2 = obj;
           break;
         }
         xmlStringBuilder.closeEmptyElement();
         obj2 = 1;
         continue;
       case Version.API03_CUPCAKE_15 /*3*/:
         if (obj != null) {
           obj2 = null;
         } else {
           xmlStringBuilder.closeElement(xmlPullParser.getName());
           obj2 = obj;
         }
         if (str != null && str.equals(xmlPullParser.getName())) {
           str = null;
         }
         if (xmlPullParser.getDepth() <= i) {
           return xmlStringBuilder;
         }
         continue;
       case Version.API04_DONUT_16 /*4*/:
         xmlStringBuilder.append(xmlPullParser.getText());
         break;
     }
     obj2 = obj;
     Object obj3 = obj2;
     eventType = xmlPullParser.next();
     obj = obj3;
   }
 }
Exemple #8
0
 public XmlStringBuilder closeElement(String name) {
   sb.append("</").append(name);
   rightAngleBracket();
   return this;
 }