Class RSS10Parser

    • Constructor Detail

      • RSS10Parser

        public RSS10Parser()
      • RSS10Parser

        protected RSS10Parser​(String type,
                              org.jdom2.Namespace ns)
    • Method Detail

      • isMyType

        public boolean isMyType​(org.jdom2.Document document)
        Indicates if a JDom document is an RSS instance that can be parsed with the parser.

        It checks for RDF ("http://www.w3.org/1999/02/22-rdf-syntax-ns#") namespace being defined in the root element and for the RSS 1.0 ("http://purl.org/rss/1.0/") namespace in the channel element.

        Specified by:
        isMyType in interface WireFeedParser
        Overrides:
        isMyType in class RSS090Parser
        Parameters:
        document - document to check if it can be parsed with this parser implementation.
        Returns:
        true if the document is RSS1., false otherwise.
      • getRSSNamespace

        protected org.jdom2.Namespace getRSSNamespace()
        Returns the namespace used by RSS elements in document of the RSS 1.0

        Overrides:
        getRSSNamespace in class RSS090Parser
        Returns:
        returns "http://purl.org/rss/1.0/".
      • parseItem

        protected Item parseItem​(org.jdom2.Element rssRoot,
                                 org.jdom2.Element eItem,
                                 Locale locale)
        Parses an item element of an RSS document looking for item information.

        It first invokes super.parseItem and then parses and injects the description property if present.

        Overrides:
        parseItem in class RSS090Parser
        Parameters:
        rssRoot - the root element of the RSS document in case it's needed for context.
        eItem - the item element to parse.
        Returns:
        the parsed RSSItem bean.
      • parseChannel

        protected WireFeed parseChannel​(org.jdom2.Element rssRoot,
                                        Locale locale)
        Description copied from class: RSS090Parser
        Parses the root element of an RSS document into a Channel bean.

        It reads title, link and description and delegates to parseImage, parseItems and parseTextInput. This delegation always passes the root element of the RSS document as different RSS version may have this information in different parts of the XML tree (no assumptions made thanks to the specs variaty)

        Overrides:
        parseChannel in class RSS090Parser
        Parameters:
        rssRoot - the root element of the RSS document to parse.
        Returns:
        the parsed Channel bean.
      • parseItemDescription

        protected Description parseItemDescription​(org.jdom2.Element rssRoot,
                                                   org.jdom2.Element eDesc)