Package com.rometools.rome.io.impl
Class RSS10Parser
- java.lang.Object
-
- com.rometools.rome.io.impl.BaseWireFeedParser
-
- com.rometools.rome.io.impl.RSS090Parser
-
- com.rometools.rome.io.impl.RSS10Parser
-
- All Implemented Interfaces:
WireFeedParser
public class RSS10Parser extends RSS090Parser
-
-
Constructor Summary
Constructors Modifier Constructor Description RSS10Parser()protectedRSS10Parser(String type, org.jdom2.Namespace ns)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.jdom2.NamespacegetRSSNamespace()Returns the namespace used by RSS elements in document of the RSS 1.0booleanisMyType(org.jdom2.Document document)Indicates if a JDom document is an RSS instance that can be parsed with the parser.protected WireFeedparseChannel(org.jdom2.Element rssRoot, Locale locale)Parses the root element of an RSS document into a Channel bean.protected ItemparseItem(org.jdom2.Element rssRoot, org.jdom2.Element eItem, Locale locale)Parses an item element of an RSS document looking for item information.protected DescriptionparseItemDescription(org.jdom2.Element rssRoot, org.jdom2.Element eDesc)-
Methods inherited from class com.rometools.rome.io.impl.RSS090Parser
getContentNamespace, getImage, getItems, getRDFNamespace, getTextInput, parse, parseImage, parseItems, parseTextInput, validateFeed
-
Methods inherited from class com.rometools.rome.io.impl.BaseWireFeedParser
extractForeignMarkup, getAttribute, getAttributeValue, getStyleSheet, getType, parseFeedModules, parseItemModules, parsePersonModules
-
-
-
-
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:
isMyTypein interfaceWireFeedParser- Overrides:
isMyTypein classRSS090Parser- 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:
getRSSNamespacein classRSS090Parser- 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:
parseItemin classRSS090Parser- 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:RSS090ParserParses 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:
parseChannelin classRSS090Parser- 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)
-
-