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