summaryrefslogtreecommitdiff
path: root/src/com/google/wireless/gdata/parser/xml/XmlMediaEntryGDataParser.java
blob: dc4b1a70c90e53cdad2331293a63b4ecacbb79ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.google.wireless.gdata.parser.xml;

import com.google.wireless.gdata.data.MediaEntry;
import com.google.wireless.gdata.data.Entry;
import com.google.wireless.gdata.data.Feed;
import com.google.wireless.gdata.parser.ParseException;

import org.xmlpull.v1.XmlPullParser;

import java.io.InputStream;

/**
 * GDataParser for a MediaEntry. This must only be used to parse an entry, not a feed, since
 * there is no such thing as a feed of media entries.
 */
public class XmlMediaEntryGDataParser extends XmlGDataParser {
  /**
   * Creates a new XmlMediaEntryGDataParser.
   * @param is The InputStream that should be parsed.
   * @param parser the XmlPullParser to use for the xml parsing
   * @throws com.google.wireless.gdata.parser.ParseException Thrown if a parser cannot be created.
   */
  public XmlMediaEntryGDataParser(InputStream is, XmlPullParser parser) throws ParseException {
    super(is, parser);
  }

  /*
  * (non-Javadoc)
  * @see com.google.wireless.gdata.parser.xml.XmlGDataParser#createFeed()
  */
  protected Feed createFeed() {
    throw new UnsupportedOperationException("there is no such thing as a feed of media entries");
  }

  /*
  * (non-Javadoc)
  * @see com.google.wireless.gdata.parser.xml.XmlGDataParser#createEntry()
  */
  protected Entry createEntry() {
    return new MediaEntry();
  }
}