FileDocCategorySizeDatePackage
XmlCalendarGDataParserFactory.javaAPI DocAndroid 1.5 API3514Wed May 06 22:41:16 BST 2009com.google.wireless.gdata.calendar.parser.xml

XmlCalendarGDataParserFactory

public class XmlCalendarGDataParserFactory extends Object implements com.google.wireless.gdata.client.GDataParserFactory
GDataParserFactory that creates XML GDataParsers and GDataSerializers for Google Calendar.

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

        this.xmlFactory = xmlFactory;
    
Methods Summary
public com.google.wireless.gdata.parser.GDataParsercreateCalendarsFeedParser(java.io.InputStream is)
Returns a parser for a calendars meta-feed.

param
is The input stream to be parsed.
return
A parser for the stream.

        XmlPullParser xmlParser;
        try {
            xmlParser = xmlFactory.createParser();
        } catch (XmlPullParserException xppe) {
            throw new ParseException("Could not create XmlPullParser", xppe);
        }
        return new XmlCalendarsGDataParser(is, xmlParser);
    
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 XmlEventsGDataParser(is, xmlParser);
    
public com.google.wireless.gdata.parser.GDataParsercreateParser(java.lang.Class entryClass, java.io.InputStream is)

        if (entryClass == CalendarEntry.class) {
            return createCalendarsFeedParser(is);
        } else if (entryClass == EventEntry.class) {
            return createParser(is);
        }
        throw new IllegalArgumentException("Unknown entry class '" + entryClass.getName()
                + "' specified.");
    
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 EventEntry}.

param
entry The {@link EventEntry} that should be serialized.
return
The {@link GDataSerializer} that will serialize this entry.
throws
IllegalArgumentException Thrown if entry is not an {@link EventEntry}.
see
GDataParserFactory#createSerializer

        if (!(entry instanceof EventEntry)) {
            throw new IllegalArgumentException("Expected EventEntry!");
        }
        EventEntry eventEntry = (EventEntry) entry;
        return new XmlEventEntryGDataSerializer(xmlFactory, eventEntry);