Пример #1
0
 public XmlStringBuilder toXML() {
   XmlStringBuilder xml = new XmlStringBuilder();
   xml.halfOpenElement("feature");
   xml.attribute("var", variable);
   xml.closeEmptyElement();
   return xml;
 }
Пример #2
0
 @Override
 protected void childrenElements(XmlStringBuilder builder) {
   if (nickName != null) {
     builder.halfOpenElement("member").attribute("nickname", nickName).closeEmptyElement();
   }
   builder.optElement("reason", reason);
   super.childrenElements(builder);
 }
Пример #3
0
 public final CharSequence toXML() {
   XmlStringBuilder buf = new XmlStringBuilder();
   buf.halfOpenElement(this.elementName).xmlnsAttribute(this.namespace).rightAngleBracket();
   for (String name : getNames()) {
     buf.element(name, getValue(name));
   }
   buf.closeElement(this.elementName);
   return buf;
 }
Пример #4
0
 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;
 }
Пример #5
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;
 }
Пример #6
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;
 }
Пример #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;
   }
 }
Пример #8
0
 public XmlStringBuilder(NamedElement e) {
   this();
   halfOpenElement(e.getElementName());
 }
Пример #9
0
 public XmlStringBuilder emptyElement(String element) {
   halfOpenElement(element);
   return closeEmptyElement();
 }
Пример #10
0
 public XmlStringBuilder prelude(String elementName, String namespace) {
   halfOpenElement(elementName);
   xmlnsAttribute(namespace);
   return this;
 }