@Override public XmlStringBuilder toXML(String enclosingNamespace) { XmlStringBuilder buf = new XmlStringBuilder(enclosingNamespace); buf.halfOpenElement(ELEMENT); addCommonAttributes(buf, enclosingNamespace); if (type != Type.available) { buf.attribute("type", type); } buf.rightAngleBracket(); buf.optElement("status", status); if (priority != Integer.MIN_VALUE) { buf.element("priority", Integer.toString(priority)); } if (mode != null && mode != Mode.available) { buf.element("show", mode); } buf.append(getExtensions(), enclosingNamespace); // Add the error sub-packet, if there is one. appendErrorIfExists(buf, enclosingNamespace); buf.closeElement(ELEMENT); return buf; }
@Override public XmlStringBuilder toXML(String enclosingNamespace) { XmlStringBuilder buf = new XmlStringBuilder(enclosingNamespace); buf.halfOpenElement(ELEMENT); addCommonAttributes(buf, enclosingNamespace); if (type != Type.available) { buf.attribute("type", type); } buf.rightAngleBracket(); buf.optElement("status", status); if (priority != Integer.MIN_VALUE) { buf.element("priority", Integer.toString(priority)); } if (mode != null && mode != Mode.available) { buf.element("show", mode); } buf.append(getExtensions(), enclosingNamespace); // Add the error sub-packet, if there is one. appendErrorIfExists(buf, enclosingNamespace); buf.closeElement(ELEMENT); return buf; }