XmlCellEntryGDataSerializer.javaAPI DocAndroid 1.5 API2938Wed May 06 22:41:16 BST


public class XmlCellEntryGDataSerializer extends
A serializer for handling GData Spreadsheets Cell entries.

Fields Summary
public static final String
The namespace to use for the GData Cell attributes
public static final String
The URI of the GData Cell namespace
Constructors Summary
public XmlCellEntryGDataSerializer( xmlFactory, entry)
Creates a new XmlCellEntryGDataSerializer.

entry the entry to be serialized

        super(xmlFactory, entry);
Methods Summary
protected voiddeclareExtraEntryNamespaces(org.xmlpull.v1.XmlSerializer serializer)
Sets up the GData Cell namespace.

serializer the serializer to use

        serializer.setPrefix(NAMESPACE_GS, NAMESPACE_GS_URI);
protected voidserializeExtraEntryContents(org.xmlpull.v1.XmlSerializer serializer, int format)

        CellEntry entry = (CellEntry) getEntry();
        int row = entry.getRow();
        int col = entry.getCol();
        String value = entry.getValue();
        String inputValue = entry.getInputValue();
        if (row < 0 || col < 0) {
            throw new ParseException("Negative row or column value");

        // cells require row & col attrs, and allow inputValue and
        // numericValue
        serializer.startTag(NAMESPACE_GS_URI, "cell");
        serializer.attribute(null /* ns */, "row", "" + row);
        serializer.attribute(null /* ns */, "col", "" + col);
        if (inputValue != null) {
            serializer.attribute(null /* ns */, "inputValue", inputValue);
        if (entry.hasNumericValue()) {
            serializer.attribute(null /* ns */, "numericValue", entry

        // set the child text...
        value = StringUtils.isEmpty(value) ? "" : value;
        serializer.endTag(NAMESPACE_GS_URI, "cell");