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;
 }
Exemple #2
0
 public XmlStringBuilder element(String name, Enum<?> content) {
   assert content != null;
   element(name, content.name());
   return this;
 }
Exemple #3
0
 public XmlStringBuilder optIntElement(String name, int value) {
   if (value >= 0) {
     element(name, String.valueOf(value));
   }
   return this;
 }
Exemple #4
0
 public XmlStringBuilder optElement(String name, Object object) {
   if (object != null) {
     element(name, object.toString());
   }
   return this;
 }
Exemple #5
0
 public XmlStringBuilder optElement(String name, Enum<?> content) {
   if (content != null) {
     element(name, content);
   }
   return this;
 }
Exemple #6
0
 public XmlStringBuilder optElement(String name, CharSequence content) {
   if (content != null) {
     element(name, content.toString());
   }
   return this;
 }