com.sun.syndication.io.impl

Class RSS090Parser

public class RSS090Parser extends BaseWireFeedParser

Field Summary
static NamespaceCONTENT_NS
static StringCONTENT_URI
static NamespaceRDF_NS
static StringRDF_URI
static NamespaceRSS_NS
static StringRSS_URI
Constructor Summary
RSS090Parser()
protected RSS090Parser(String type)
Method Summary
protected NamespacegetContentNamespace()
Returns the namespace used by Content Module elements in document.
protected ElementgetImage(Element rssRoot)
This method exists because RSS0.90 and RSS1.0 have the 'image' element under the root elemment.
protected ListgetItems(Element rssRoot)
This method exists because RSS0.90 and RSS1.0 have the 'item' elements under the root elemment.
protected NamespacegetRDFNamespace()
Returns the namespace used by RDF elements in document of the RSS version the parser supports.
protected NamespacegetRSSNamespace()
Returns the namespace used by RSS elements in document of the RSS version the parser supports.
protected ElementgetTextInput(Element rssRoot)
This method exists because RSS0.90 and RSS1.0 have the 'textinput' element under the root elemment.
booleanisMyType(Document document)
WireFeedparse(Document document, boolean validate)
protected WireFeedparseChannel(Element rssRoot)
Parses the root element of an RSS document into a Channel bean.
protected ImageparseImage(Element rssRoot)
Parses the root element of an RSS document looking for image information.
protected ItemparseItem(Element rssRoot, Element eItem)
Parses an item element of an RSS document looking for item information.
protected ListparseItems(Element rssRoot)
Parses the root element of an RSS document looking for all items information.
protected TextInputparseTextInput(Element rssRoot)
Parses the root element of an RSS document looking for text-input information.
protected voidvalidateFeed(Document document)

Field Detail

CONTENT_NS

private static final Namespace CONTENT_NS

CONTENT_URI

private static final String CONTENT_URI

RDF_NS

private static final Namespace RDF_NS

RDF_URI

private static final String RDF_URI

RSS_NS

private static final Namespace RSS_NS

RSS_URI

private static final String RSS_URI

Constructor Detail

RSS090Parser

public RSS090Parser()

RSS090Parser

protected RSS090Parser(String type)

Method Detail

getContentNamespace

protected Namespace getContentNamespace()
Returns the namespace used by Content Module elements in document.

This implementation returns the EMTPY namespace.

Returns: returns the EMPTY namespace.

getImage

protected Element getImage(Element rssRoot)
This method exists because RSS0.90 and RSS1.0 have the 'image' element under the root elemment. And RSS0.91, RSS0.02, RSS0.93, RSS0.94 and RSS2.0 have it under the 'channel' element.

getItems

protected List getItems(Element rssRoot)
This method exists because RSS0.90 and RSS1.0 have the 'item' elements under the root elemment. And RSS0.91, RSS0.02, RSS0.93, RSS0.94 and RSS2.0 have the item elements under the 'channel' element.

getRDFNamespace

protected Namespace getRDFNamespace()
Returns the namespace used by RDF elements in document of the RSS version the parser supports.

This implementation returns the EMTPY namespace.

Returns: returns the EMPTY namespace.

getRSSNamespace

protected Namespace getRSSNamespace()
Returns the namespace used by RSS elements in document of the RSS version the parser supports.

This implementation returns the EMTPY namespace.

Returns: returns the EMPTY namespace.

getTextInput

protected Element getTextInput(Element rssRoot)
This method exists because RSS0.90 and RSS1.0 have the 'textinput' element under the root elemment. And RSS0.91, RSS0.02, RSS0.93, RSS0.94 and RSS2.0 have it under the 'channel' element.

isMyType

public boolean isMyType(Document document)

parse

public WireFeed parse(Document document, boolean validate)

parseChannel

protected WireFeed parseChannel(Element rssRoot)
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)

Parameters: rssRoot the root element of the RSS document to parse.

Returns: the parsed Channel bean.

parseImage

protected Image parseImage(Element rssRoot)
Parses the root element of an RSS document looking for image information.

It reads title and url out of the 'image' element.

Parameters: rssRoot the root element of the RSS document to parse for image information.

Returns: the parsed image bean.

parseItem

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

It reads title and link out of the 'item' element.

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.

parseItems

protected List parseItems(Element rssRoot)
Parses the root element of an RSS document looking for all items information.

It iterates through the item elements list, obtained from the getItems() method, and invoke parseItem() for each item element. The resulting RSSItem of each item element is stored in a list.

Parameters: rssRoot the root element of the RSS document to parse for all items information.

Returns: a list with all the parsed RSSItem beans.

parseTextInput

protected TextInput parseTextInput(Element rssRoot)
Parses the root element of an RSS document looking for text-input information.

It reads title, description, name and link out of the 'textinput' or 'textInput' element.

Parameters: rssRoot the root element of the RSS document to parse for text-input information.

Returns: the parsed RSSTextInput bean.

validateFeed

protected void validateFeed(Document document)
Copyright © Sun Microsystems. All Rights Reserved.