FileDocCategorySizeDatePackage
XmlGroupEntryGDataParser.javaAPI DocAndroid 1.5 API1916Wed May 06 22:41:16 BST 2009com.google.wireless.gdata.contacts.parser.xml

XmlGroupEntryGDataParser

public class XmlGroupEntryGDataParser extends com.google.wireless.gdata.parser.xml.XmlGDataParser
GDataParser for a contact groups feed.

Fields Summary
Constructors Summary
public XmlGroupEntryGDataParser(InputStream is, XmlPullParser parser)
Creates a new XmlGroupEntryGDataParser.

param
is The InputStream that should be parsed.
param
parser the XmlPullParser to use for the xml parsing
throws
ParseException Thrown if a parser cannot be created.

    super(is, parser);
  
Methods Summary
protected com.google.wireless.gdata.data.EntrycreateEntry()

    return new GroupEntry();
  
protected com.google.wireless.gdata.data.FeedcreateFeed()

    return new GroupsFeed();
  
protected voidhandleExtraElementInEntry(com.google.wireless.gdata.data.Entry entry)

    XmlPullParser parser = getParser();

    if (!(entry instanceof GroupEntry)) {
      throw new IllegalArgumentException("Expected GroupEntry!");
    }
    GroupEntry groupEntry = (GroupEntry) entry;
    String name = parser.getName();
    if ("systemGroup".equals(name)) {
      String systemGroup = parser.getAttributeValue(null /* ns */, "id");
      // if the systemGroup is the empty string, convert it to a null
      if (StringUtils.isEmpty(systemGroup)) systemGroup = null;
      groupEntry.setSystemGroup(systemGroup);
    }