public abstract class AbstractAtomFeedParser<T>
Beta
Abstract base class for an Atom feed parser when the feed type is known in advance.
Implementation is not thread-safe.
Type Parameter
Name | Description |
T |
Constructors
AbstractAtomFeedParser(XmlNamespaceDictionary namespaceDictionary, XmlPullParser parser, InputStream inputStream, Class<T> feedClass)
protected AbstractAtomFeedParser(XmlNamespaceDictionary namespaceDictionary, XmlPullParser parser, InputStream inputStream, Class<T> feedClass)
Name | Description |
namespaceDictionary | XmlNamespaceDictionary XML namespace dictionary |
parser | org.xmlpull.v1.XmlPullParser XML pull parser to use |
inputStream | InputStream input stream to read |
feedClass | Class<T> feed class to parse |
Methods
close()
public void close()
Closes the underlying parser.
Type | Description |
IOException |
getFeedClass()
public final Class<T> getFeedClass()
Returns the feed class to parse.
Type | Description |
Class<T> |
getInputStream()
public final InputStream getInputStream()
Returns the input stream to read.
Type | Description |
InputStream |
getNamespaceDictionary()
public final XmlNamespaceDictionary getNamespaceDictionary()
Returns the XML namespace dictionary.
Type | Description |
XmlNamespaceDictionary |
getParser()
public final XmlPullParser getParser()
Returns the XML pull parser to use.
Type | Description |
org.xmlpull.v1.XmlPullParser |
parseEntryInternal()
protected abstract Object parseEntryInternal()
Parses a single entry.
Type | Description |
Object | object representing the entry |
Type | Description |
IOException | I/O exception |
org.xmlpull.v1.XmlPullParserException | I/O exception |
parseFeed()
public T parseFeed()
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.
Type | Description |
T |
Type | Description |
IOException | I/O exception |
org.xmlpull.v1.XmlPullParserException | I/O exception |
parseNextEntry()
public Object parseNextEntry()
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().
Type | Description |
Object |
Type | Description |
IOException | I/O exception |
org.xmlpull.v1.XmlPullParserException | I/O exception |