Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.sun.syndication.io.impl
Class RSS090Parser  view RSS090Parser download RSS090Parser.java

java.lang.Object
  extended bycom.sun.syndication.io.impl.BaseWireFeedParser
      extended bycom.sun.syndication.io.impl.RSS090Parser
All Implemented Interfaces:
com.sun.syndication.io.WireFeedParser
Direct Known Subclasses:
RSS091UserlandParser, RSS10Parser

public class RSS090Parser
extends BaseWireFeedParser


Field Summary
private static org.jdom.Namespace RDF_NS
           
private static java.lang.String RDF_URI
           
private static org.jdom.Namespace RSS_NS
           
private static java.lang.String RSS_URI
           
 
Fields inherited from class com.sun.syndication.io.impl.BaseWireFeedParser
 
Constructor Summary
  RSS090Parser()
           
protected RSS090Parser(java.lang.String type)
           
 
Method Summary
protected  org.jdom.Element getImage(org.jdom.Element rssRoot)
          This method exists because RSS0.90 and RSS1.0 have the 'image' element under the root elemment.
protected  java.util.List getItems(org.jdom.Element rssRoot)
          This method exists because RSS0.90 and RSS1.0 have the 'item' elements under the root elemment.
protected  org.jdom.Namespace getRDFNamespace()
          Returns the namespace used by RDF elements in document of the RSS version the parser supports.
protected  org.jdom.Namespace getRSSNamespace()
          Returns the namespace used by RSS elements in document of the RSS version the parser supports.
protected  org.jdom.Element getTextInput(org.jdom.Element rssRoot)
          This method exists because RSS0.90 and RSS1.0 have the 'textinput' element under the root elemment.
 boolean isMyType(org.jdom.Document document)
          Inspects an XML Document (JDOM) to check if it can parse it.
 com.sun.syndication.feed.WireFeed parse(org.jdom.Document document, boolean validate)
          Parses an XML document (JDOM Document) into a feed bean.
protected  com.sun.syndication.feed.WireFeed parseChannel(org.jdom.Element rssRoot)
          Parses the root element of an RSS document into a Channel bean.
protected  com.sun.syndication.feed.rss.Image parseImage(org.jdom.Element rssRoot)
          Parses the root element of an RSS document looking for image information.
protected  com.sun.syndication.feed.rss.Item parseItem(org.jdom.Element rssRoot, org.jdom.Element eItem)
          Parses an item element of an RSS document looking for item information.
protected  java.util.List parseItems(org.jdom.Element rssRoot)
          Parses the root element of an RSS document looking for all items information.
protected  com.sun.syndication.feed.rss.TextInput parseTextInput(org.jdom.Element rssRoot)
          Parses the root element of an RSS document looking for text-input information.
protected  void validateFeed(org.jdom.Document document)
           
 
Methods inherited from class com.sun.syndication.io.impl.BaseWireFeedParser
getType, parseFeedModules, parseItemModules
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RDF_URI

private static final java.lang.String RDF_URI
See Also:
Constant Field Values

RSS_URI

private static final java.lang.String RSS_URI
See Also:
Constant Field Values

RDF_NS

private static final org.jdom.Namespace RDF_NS

RSS_NS

private static final org.jdom.Namespace RSS_NS
Constructor Detail

RSS090Parser

public RSS090Parser()

RSS090Parser

protected RSS090Parser(java.lang.String type)
Method Detail

isMyType

public boolean isMyType(org.jdom.Document document)
Description copied from interface: com.sun.syndication.io.WireFeedParser
Inspects an XML Document (JDOM) to check if it can parse it.

It checks if the given document if the type of feeds the parser understands.


parse

public com.sun.syndication.feed.WireFeed parse(org.jdom.Document document,
                                               boolean validate)
                                        throws java.lang.IllegalArgumentException,
                                               com.sun.syndication.io.FeedException
Description copied from interface: com.sun.syndication.io.WireFeedParser
Parses an XML document (JDOM Document) into a feed bean.


validateFeed

protected void validateFeed(org.jdom.Document document)
                     throws com.sun.syndication.io.FeedException

getRSSNamespace

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

This implementation returns the EMTPY namespace.


getRDFNamespace

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

This implementation returns the EMTPY namespace.


parseChannel

protected com.sun.syndication.feed.WireFeed parseChannel(org.jdom.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)


getItems

protected java.util.List getItems(org.jdom.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.


getImage

protected org.jdom.Element getImage(org.jdom.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.


getTextInput

protected org.jdom.Element getTextInput(org.jdom.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.


parseImage

protected com.sun.syndication.feed.rss.Image parseImage(org.jdom.Element rssRoot)
Parses the root element of an RSS document looking for image information.

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


parseItems

protected java.util.List parseItems(org.jdom.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.


parseItem

protected com.sun.syndication.feed.rss.Item parseItem(org.jdom.Element rssRoot,
                                                      org.jdom.Element eItem)
Parses an item element of an RSS document looking for item information.

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


parseTextInput

protected com.sun.syndication.feed.rss.TextInput parseTextInput(org.jdom.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.