@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; }
public XmlStringBuilder toXML() { XmlStringBuilder xml = new XmlStringBuilder(this); xml.optIntAttribute("maxchars", getMaxChars()); xml.optIntAttribute("maxstanzas", getMaxStanzas()); xml.optIntAttribute("seconds", getSeconds()); if (getSince() != null) { xml.attribute("since", XmppDateTime.formatXEP0082Date(getSince())); } xml.closeEmptyElement(); return xml; }
/** * Add a new element to this builder, with the {@link java.util.Date} instance as its content, * which will get formated with {@link XmppDateTime#formatXEP0082Date(Date)}. * * @param name element name * @param content content of element * @return this XmlStringBuilder */ public XmlStringBuilder element(String name, Date content) { assert content != null; return element(name, XmppDateTime.formatXEP0082Date(content)); }
/** * Add a new attribute to this builder, with the {@link java.util.Date} instance as its value, * which will get formated with {@link XmppDateTime#formatXEP0082Date(Date)}. * * @param name name of attribute * @param value value of attribute * @return this XmlStringBuilder */ public XmlStringBuilder attribute(String name, Date value) { assert value != null; return attribute(name, XmppDateTime.formatXEP0082Date(value)); }