FileDocCategorySizeDatePackage
XmlSubscribedFeedsGDataParserFactory.javaAPI DocAndroid 1.5 API3039Wed May 06 22:41:16 BST 2009com.google.wireless.gdata.subscribedfeeds.parser.xml

XmlSubscribedFeedsGDataParserFactory

public class XmlSubscribedFeedsGDataParserFactory extends Object implements com.google.wireless.gdata.client.GDataParserFactory
GDataParserFactory that creates XML GDataParsers and GDataSerializers for Subscribed Feeds.

Fields Summary
private final com.google.wireless.gdata.parser.xml.XmlParserFactory
xmlFactory
Constructors Summary
public XmlSubscribedFeedsGDataParserFactory(com.google.wireless.gdata.parser.xml.XmlParserFactory xmlFactory)

        this.xmlFactory = xmlFactory;
    
Methods Summary
public com.google.wireless.gdata.parser.GDataParsercreateParser(java.io.InputStream is)

        XmlPullParser xmlParser;
        try {
            xmlParser = xmlFactory.createParser();
        } catch (XmlPullParserException xppe) {
            throw new ParseException("Could not create XmlPullParser", xppe);
        }
        return new XmlSubscribedFeedsGDataParser(is, xmlParser);
    
public com.google.wireless.gdata.parser.GDataParsercreateParser(java.lang.Class entryClass, java.io.InputStream is)

        if (entryClass != SubscribedFeedsEntry.class) {
            throw new IllegalArgumentException(
                    "SubscribedFeeds supports only a single feed type");
        }
        // we don't have feed sub-types, so just return the default
        return createParser(is);
    
public com.google.wireless.gdata.serializer.GDataSerializercreateSerializer(com.google.wireless.gdata.data.Entry entry)
Creates a new {@link GDataSerializer} for the provided entry. The entry must be an instance of {@link SubscribedFeedsEntry}.

param
entry The {@link SubscribedFeedsEntry} that should be serialized.
return
The {@link GDataSerializer} that will serialize this entry.
throws
IllegalArgumentException Thrown if entry is not a {@link SubscribedFeedsEntry}.
see
com.google.wireless.gdata.client.GDataParserFactory#createSerializer

        if (!(entry instanceof SubscribedFeedsEntry)) {
            throw new IllegalArgumentException(
                    "Expected SubscribedFeedsEntry!");
        }
        SubscribedFeedsEntry subscribedFeedsEntry =
                (SubscribedFeedsEntry) entry;
        return new XmlSubscribedFeedsEntryGDataSerializer(xmlFactory,
                subscribedFeedsEntry);