Android Utililty Methods XML Serializer Write

List of utility methods to do XML Serializer Write

Description

The list of methods to do XML Serializer Write are organized into topic(s).

Method

voidwriteMapXml(Map val, String name, XmlSerializer out)
Flatten a Map into an XmlSerializer.
if (val == null) {
    out.startTag(null, "null");
    out.endTag(null, "null");
    return;
Set s = val.entrySet();
Iterator i = s.iterator();
out.startTag(null, "map");
...
voidwriteMapXml(Map val, String name, XmlSerializer out)
Flatten a Map into an XmlSerializer.
if (val == null) {
    out.startTag(null, "null");
    out.endTag(null, "null");
    return;
Set s = val.entrySet();
Iterator i = s.iterator();
out.startTag(null, "map");
...
voidwriteSetXml(Set val, String name, XmlSerializer out)
write Set Xml
if (val == null) {
    out.startTag(null, "null");
    out.endTag(null, "null");
    return;
out.startTag(null, "set");
if (name != null) {
    out.attribute(null, "name", name);
...
voidwriteSetXml(Set val, String name, XmlSerializer out)
write Set Xml
if (val == null) {
    out.startTag(null, "null");
    out.endTag(null, "null");
    return;
out.startTag(null, "set");
if (name != null) {
    out.attribute(null, "name", name);
...
voidwriteSetXml(Set val, String name, XmlSerializer out)
write Set Xml
if (val == null) {
    out.startTag(null, "null");
    out.endTag(null, "null");
    return;
out.startTag(null, "set");
if (name != null) {
    out.attribute(null, "name", name);
...
voidwriteSimpleElement(XmlSerializer serializer, String namespace, String elementName, String elementText)
Writes a simple element such as johndoe.
if (elementName == null) {
    throw new XmlPullParserException(
            "name for element can not be null");
serializer.startTag(namespace, elementName);
if (elementText == null) {
    serializer.attribute(XSI_NS, "nil", "true");
} else {
...
voidwriteSimpleElement(XmlSerializer serializer, String namespace, String elementName, String elementText)
Writes a simple element such as johndoe.
if (elementName == null) {
    throw new XmlPullParserException(
            "name for element can not be null");
serializer.startTag(namespace, elementName);
if (elementText == null) {
    serializer.attribute(XSI_NS, "nil", "true");
} else {
...
voidwriteStringArrayXml(String[] val, String name, XmlSerializer out)
Flatten a String[] into an XmlSerializer.
if (val == null) {
    out.startTag(null, "null");
    out.endTag(null, "null");
    return;
out.startTag(null, "string-array");
if (name != null) {
    out.attribute(null, "name", name);
...
voidwriteStringArrayXml(String[] val, String name, XmlSerializer out)
Flatten a String[] into an XmlSerializer.
if (val == null) {
    out.startTag(null, "null");
    out.endTag(null, "null");
    return;
out.startTag(null, "string-array");
if (name != null) {
    out.attribute(null, "name", name);
...
voidwriteStringAttribute(XmlSerializer out, String name, String value)
write String Attribute
if (value != null) {
    out.attribute(null, name, value);