Class AtomFeedParser<T,E>
- java.lang.Object
-
- com.google.api.client.xml.atom.AbstractAtomFeedParser<T>
-
- com.google.api.client.http.xml.atom.AtomFeedParser<T,E>
-
- Type Parameters:
T
- feed typeE
- entry type
@Beta public final class AtomFeedParser<T,E> extends AbstractAtomFeedParser<T>
Beta
Atom feed pull parser when the Atom entry class is known in advance.Implementation is not thread-safe.
- Since:
- 1.4
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Class<E>
entryClass
Atom entry class to parse.
-
Constructor Summary
Constructors Constructor Description AtomFeedParser(XmlNamespaceDictionary namespaceDictionary, org.xmlpull.v1.XmlPullParser parser, java.io.InputStream inputStream, java.lang.Class<T> feedClass, java.lang.Class<E> entryClass)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T,E>
AtomFeedParser<T,E>create(HttpResponse response, XmlNamespaceDictionary namespaceDictionary, java.lang.Class<T> feedClass, java.lang.Class<E> entryClass)
Parses the given HTTP response using the given feed class and entry class.java.lang.Class<E>
getEntryClass()
Returns the Atom entry class to parse.protected java.lang.Object
parseEntryInternal()
Parses a single entry.E
parseNextEntry()
Parse the next item in the feed and return a new parsed instance of the item type.-
Methods inherited from class com.google.api.client.xml.atom.AbstractAtomFeedParser
close, getFeedClass, getInputStream, getNamespaceDictionary, getParser, parseFeed
-
-
-
-
Field Detail
-
entryClass
private final java.lang.Class<E> entryClass
Atom entry class to parse.
-
-
Constructor Detail
-
AtomFeedParser
public AtomFeedParser(XmlNamespaceDictionary namespaceDictionary, org.xmlpull.v1.XmlPullParser parser, java.io.InputStream inputStream, java.lang.Class<T> feedClass, java.lang.Class<E> entryClass)
- Parameters:
namespaceDictionary
- XML namespace dictionaryparser
- XML pull parser to useinputStream
- input stream to readfeedClass
- feed class to parse- Since:
- 1.5
-
-
Method Detail
-
parseNextEntry
public E parseNextEntry() throws java.io.IOException, org.xmlpull.v1.XmlPullParserException
Description copied from class:AbstractAtomFeedParser
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 returnnull
and automatically close the parser (in which case there is no need to callAbstractAtomFeedParser.close()
.- Overrides:
parseNextEntry
in classAbstractAtomFeedParser<T>
- Throws:
java.io.IOException
- I/O exceptionorg.xmlpull.v1.XmlPullParserException
- XML pull parser exception
-
parseEntryInternal
protected java.lang.Object parseEntryInternal() throws java.io.IOException, org.xmlpull.v1.XmlPullParserException
Description copied from class:AbstractAtomFeedParser
Parses a single entry.- Specified by:
parseEntryInternal
in classAbstractAtomFeedParser<T>
- Returns:
- object representing the entry
- Throws:
java.io.IOException
- I/O exceptionorg.xmlpull.v1.XmlPullParserException
- XML pull parser exception
-
getEntryClass
public final java.lang.Class<E> getEntryClass()
Returns the Atom entry class to parse.- Since:
- 1.5
-
create
public static <T,E> AtomFeedParser<T,E> create(HttpResponse response, XmlNamespaceDictionary namespaceDictionary, java.lang.Class<T> feedClass, java.lang.Class<E> entryClass) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException
Parses the given HTTP response using the given feed class and entry class.- Type Parameters:
T
- feed typeE
- entry type- Parameters:
response
- HTTP responsenamespaceDictionary
- XML namespace dictionaryfeedClass
- feed classentryClass
- entry class- Returns:
- Atom feed parser
- Throws:
java.io.IOException
- I/O exceptionorg.xmlpull.v1.XmlPullParserException
- XML pull parser exception
-
-