Class AtomFeedParser<T,​E>

  • Type Parameters:
    T - feed type
    E - 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
    Author:
    Yaniv Inbar
    • Constructor Detail

      • AtomFeedParser

        public AtomFeedParser​(XmlNamespaceDictionary namespaceDictionary,
                              org.xmlpull.v1.XmlPullParser parser,
                              InputStream inputStream,
                              Class<T> feedClass,
                              Class<E> entryClass)
        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

      • parseNextEntry

        public E parseNextEntry()
                         throws 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 return null and automatically close the parser (in which case there is no need to call AbstractAtomFeedParser.close().
        Overrides:
        parseNextEntry in class AbstractAtomFeedParser<T>
        Throws:
        IOException - I/O exception
        org.xmlpull.v1.XmlPullParserException - XML pull parser exception
      • getEntryClass

        public final 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,
                                                                   Class<T> feedClass,
                                                                   Class<E> entryClass)
                                                            throws IOException,
                                                                   org.xmlpull.v1.XmlPullParserException
        Parses the given HTTP response using the given feed class and entry class.
        Type Parameters:
        T - feed type
        E - entry type
        Parameters:
        response - HTTP response
        namespaceDictionary - XML namespace dictionary
        feedClass - feed class
        entryClass - entry class
        Returns:
        Atom feed parser
        Throws:
        IOException - I/O exception
        org.xmlpull.v1.XmlPullParserException - XML pull parser exception