com.google.api.client.xml.atom
Class AbstractAtomFeedParser<T>

java.lang.Object
  extended by com.google.api.client.xml.atom.AbstractAtomFeedParser<T>
Type Parameters:
T - feed type
Direct Known Subclasses:
AtomFeedParser

public abstract class AbstractAtomFeedParser<T>
extends Object

Abstract base class for an Atom feed parser when the feed type is known in advance.

Implementation is not thread-safe.

Since:
1.0
Author:
Yaniv Inbar

Field Summary
 Class<T> feedClass
          Deprecated. (scheduled to be made private final in 1.6) Use getFeedClass()
 InputStream inputStream
          Deprecated. (scheduled to be made private final in 1.6) Use getInputStream()
 XmlNamespaceDictionary namespaceDictionary
          Deprecated. (scheduled to be made private final in 1.6) Use getNamespaceDictionary()
 org.xmlpull.v1.XmlPullParser parser
          Deprecated. (scheduled to be made private final in 1.6) Use getParser()
 
Constructor Summary
  AbstractAtomFeedParser()
          Deprecated. (scheduled to be removed in 1.6) Use AbstractAtomFeedParser(XmlNamespaceDictionary, XmlPullParser, InputStream, Class)
protected AbstractAtomFeedParser(XmlNamespaceDictionary namespaceDictionary, org.xmlpull.v1.XmlPullParser parser, InputStream inputStream, Class<T> feedClass)
           
 
Method Summary
 void close()
          Closes the underlying parser.
 Class<T> getFeedClass()
          Returns the feed class to parse.
 InputStream getInputStream()
          Returns the input stream to read.
 XmlNamespaceDictionary getNamespaceDictionary()
          Returns the XML namespace dictionary.
 org.xmlpull.v1.XmlPullParser getParser()
          Returns the XML pull parser to use.
protected abstract  Object parseEntryInternal()
          Parses a single entry.
 T parseFeed()
          Parse the feed and return a new parsed instance of the feed type.
 Object parseNextEntry()
          Parse the next item in the feed and return a new parsed instance of the item type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parser

@Deprecated
public org.xmlpull.v1.XmlPullParser parser
Deprecated. (scheduled to be made private final in 1.6) Use getParser()
XML pull parser to use.


inputStream

@Deprecated
public InputStream inputStream
Deprecated. (scheduled to be made private final in 1.6) Use getInputStream()
Input stream to read.


feedClass

@Deprecated
public Class<T> feedClass
Deprecated. (scheduled to be made private final in 1.6) Use getFeedClass()
Feed class to parse.


namespaceDictionary

@Deprecated
public XmlNamespaceDictionary namespaceDictionary
Deprecated. (scheduled to be made private final in 1.6) Use getNamespaceDictionary()
XML namespace dictionary.

Constructor Detail

AbstractAtomFeedParser

@Deprecated
public AbstractAtomFeedParser()
Deprecated. (scheduled to be removed in 1.6) Use AbstractAtomFeedParser(XmlNamespaceDictionary, XmlPullParser, InputStream, Class)


AbstractAtomFeedParser

protected AbstractAtomFeedParser(XmlNamespaceDictionary namespaceDictionary,
                                 org.xmlpull.v1.XmlPullParser parser,
                                 InputStream inputStream,
                                 Class<T> feedClass)
Parameters:
namespaceDictionary - XML namespace dictionary
parser - XML pull parser to use
inputStream - input stream to read
feedClass - feed class to parse
Since:
1.5
Method Detail

getParser

public final org.xmlpull.v1.XmlPullParser getParser()
Returns the XML pull parser to use.

Since:
1.5

getInputStream

public final InputStream getInputStream()
Returns the input stream to read.

Since:
1.5

getFeedClass

public final Class<T> getFeedClass()
Returns the feed class to parse.

Since:
1.5

getNamespaceDictionary

public final XmlNamespaceDictionary getNamespaceDictionary()
Returns the XML namespace dictionary.

Since:
1.5

parseFeed

public T parseFeed()
            throws IOException,
                   org.xmlpull.v1.XmlPullParserException
Parse the feed and return a new parsed instance of the feed type. This method can be skipped if all you want are the items.

Throws:
IOException - I/O exception
org.xmlpull.v1.XmlPullParserException - XML pull parser exception

parseNextEntry

public Object parseNextEntry()
                      throws IOException,
                             org.xmlpull.v1.XmlPullParserException
Parse the next item in the feed and return a new parsed instance of the item type. If there is no item to parse, it will return null and automatically close the parser (in which case there is no need to call close().

Throws:
IOException - I/O exception
org.xmlpull.v1.XmlPullParserException - XML pull parser exception

close

public void close()
           throws IOException
Closes the underlying parser.

Throws:
IOException

parseEntryInternal

protected abstract Object parseEntryInternal()
                                      throws IOException,
                                             org.xmlpull.v1.XmlPullParserException
Parses a single entry.

Returns:
object representing the entry
Throws:
IOException - I/O exception
org.xmlpull.v1.XmlPullParserException - XML pull parser exception


Copyright © 2011 Google. All Rights Reserved.