List of utility methods to do XML Serializer Write
void | multipleTexts(final XmlSerializer serializer, final String prefix, final String... tagAndText) Insert pairs of attribute-less tags and enclosed texts in a XML serializer output for (int i = 0; i < tagAndText.length; i += 2) { simpleText(serializer, prefix, tagAndText[i], tagAndText[i + 1]); |
void | simpleText(final XmlSerializer serializer, final String prefix, final String tag, final String text) Insert an attribute-less tag with enclosed text in a XML serializer output. if (text != null) {
serializer.startTag(prefix, tag);
serializer.text(text);
serializer.endTag(prefix, tag);
|
void | textTag(XmlSerializer xml, String namespace, String name, Object text) text Tag xml.startTag(namespace, name);
if (text != null)
xml.text(text.toString());
xml.endTag(namespace, name);
|
void | writeBitmapAttribute(XmlSerializer out, String name, Bitmap value) write Bitmap Attribute if (value != null) { final ByteArrayOutputStream os = new ByteArrayOutputStream(); value.compress(CompressFormat.PNG, 90, os); writeByteArrayAttribute(out, name, os.toByteArray()); |
void | writeBitmapAttribute(XmlSerializer out, String name, Bitmap value) write Bitmap Attribute if (value != null) { final ByteArrayOutputStream os = new ByteArrayOutputStream(); value.compress(CompressFormat.PNG, 90, os); writeByteArrayAttribute(out, name, os.toByteArray()); |
void | writeBooleanAttribute(XmlSerializer out, String name, boolean value) write Boolean Attribute out.attribute(null, name, Boolean.toString(value)); |
void | writeBooleanAttribute(XmlSerializer out, String name, boolean value) write Boolean Attribute out.attribute(null, name, Boolean.toString(value)); |
void | writeByteArrayAttribute(XmlSerializer out, String name, byte[] value) write Byte Array Attribute if (value != null) {
out.attribute(null, name,
Base64.encodeToString(value, Base64.DEFAULT));
|
void | writeByteArrayXml(byte[] val, String name, XmlSerializer out) Flatten a byte[] into an XmlSerializer. if (val == null) { out.startTag(null, "null"); out.endTag(null, "null"); return; out.startTag(null, "byte-array"); if (name != null) { out.attribute(null, "name", name); ... |
void | writeByteArrayXml(byte[] val, String name, XmlSerializer out) Flatten a byte[] into an XmlSerializer. if (val == null) { out.startTag(null, "null"); out.endTag(null, "null"); return; out.startTag(null, "byte-array"); if (name != null) { out.attribute(null, "name", name); ... |