Methods Summary |
---|
protected com.google.wireless.gdata.data.Entry | createEntry()
return new ListEntry();
|
protected com.google.wireless.gdata.data.Feed | createFeed()
return new ListFeed();
|
protected void | handleExtraElementInEntry(com.google.wireless.gdata.data.Entry 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 void | handleExtraElementInFeed(com.google.wireless.gdata.data.Feed 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)) {
return;
}
// 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)) {
listFeed.setEditUri(href);
}
}
|