XmlListGDataParser.javaAPI DocAndroid 1.5 API3729Wed May 06 22:41:16 BST


public class XmlListGDataParser extends
Parser for non-Atom data in a GData Spreadsheets List-based feed.

Fields Summary
private static final String
The rel ID used by the server to identify the URLs for List POSTs (updates)
Constructors Summary
public XmlListGDataParser(InputStream is, XmlPullParser xmlParser)
Creates a new XmlListGDataParser.

is the stream from which to read the data
xmlParser the XmlPullParser to use to parse the raw XML
ParseException if the super-class throws one

        super(is, xmlParser);
Methods Summary

        return new ListEntry();

        return new ListFeed();
protected voidhandleExtraElementInEntry( entry)

        XmlPullParser parser = getParser();
        if (!(entry instanceof ListEntry)) {
            throw new IllegalArgumentException("Expected ListEntry!");
        ListEntry row = (ListEntry) entry;

        String name = parser.getName();
        row.setValue(name, XmlUtils.extractChildText(parser));
protected voidhandleExtraElementInFeed( feed)

        XmlPullParser parser = getParser();
        if (!(feed instanceof ListFeed)) {
            throw new IllegalArgumentException("Expected ListFeed!");
        ListFeed listFeed = (ListFeed) feed;

        String name = parser.getName();
        if (!"link".equals(name)) {

        // lists store column data in the gsx namespace:
        // <gsx:columnheader>data</gsx:columnheader>
        // The columnheader tag names are the scrubbed values of the first row.
        // We extract them all and store them as keys in a Map.
        int numAttrs = parser.getAttributeCount();
        String rel = null;
        String href = null;
        String attrName = null;
        for (int i = 0; i < numAttrs; ++i) {
            attrName = parser.getAttributeName(i);
            if ("rel".equals(attrName)) {
                rel = parser.getAttributeValue(i);
            } else if ("href".equals(attrName)) {
                href = parser.getAttributeValue(i);
        if (!(StringUtils.isEmpty(rel) || StringUtils.isEmpty(href))) {
            if (LIST_FEED_POST_REL.equals(rel)) {