Class AbstractAtomFeedParser<T> (1.43.0)

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.

Inheritance

Object > AbstractAtomFeedParser<T>

Type Parameter

NameDescription
T

Constructors

AbstractAtomFeedParser(XmlNamespaceDictionary namespaceDictionary, XmlPullParser parser, InputStream inputStream, Class<T> feedClass)

protected AbstractAtomFeedParser(XmlNamespaceDictionary namespaceDictionary, XmlPullParser parser, InputStream inputStream, Class<T> feedClass)
Parameters
NameDescription
namespaceDictionaryXmlNamespaceDictionary

XML namespace dictionary

parserorg.xmlpull.v1.XmlPullParser

XML pull parser to use

inputStreamInputStream

input stream to read

feedClassClass<T>

feed class to parse

Methods

close()

public void close()

Closes the underlying parser.

Exceptions
TypeDescription
IOException

getFeedClass()

public final Class<T> getFeedClass()

Returns the feed class to parse.

Returns
TypeDescription
Class<T>

getInputStream()

public final InputStream getInputStream()

Returns the input stream to read.

Returns
TypeDescription
InputStream

getNamespaceDictionary()

public final XmlNamespaceDictionary getNamespaceDictionary()

Returns the XML namespace dictionary.

Returns
TypeDescription
XmlNamespaceDictionary

getParser()

public final XmlPullParser getParser()

Returns the XML pull parser to use.

Returns
TypeDescription
org.xmlpull.v1.XmlPullParser

parseEntryInternal()

protected abstract Object parseEntryInternal()

Parses a single entry.

Returns
TypeDescription
Object

object representing the entry

Exceptions
TypeDescription
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.

Returns
TypeDescription
T
Exceptions
TypeDescription
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().

Returns
TypeDescription
Object
Exceptions
TypeDescription
IOException

I/O exception

org.xmlpull.v1.XmlPullParserException

I/O exception