예제 #1
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;
 }
예제 #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;
 }