com.sun.syndication.io.impl
クラス RSS090Parser

java.lang.Object
  上位を拡張 com.sun.syndication.io.impl.BaseWireFeedParser
      上位を拡張 com.sun.syndication.io.impl.RSS090Parser
すべての実装されたインタフェース:
WireFeedParser
直系の既知のサブクラス:
RSS091UserlandParser, RSS10Parser

public class RSS090Parser
extends BaseWireFeedParser


コンストラクタの概要
  RSS090Parser()
           
protected RSS090Parser(java.lang.String type, Namespace ns)
           
 
メソッドの概要
protected  Namespace getContentNamespace()
          Returns the namespace used by Content Module elements in document.
protected  Element getImage(Element rssRoot)
          This method exists because RSS0.90 and RSS1.0 have the 'image' element under the root elemment.
protected  java.util.List getItems(Element rssRoot)
          This method exists because RSS0.90 and RSS1.0 have the 'item' elements under the root elemment.
protected  Namespace getRDFNamespace()
          Returns the namespace used by RDF elements in document of the RSS version the parser supports.
protected  Namespace getRSSNamespace()
          Returns the namespace used by RSS elements in document of the RSS version the parser supports.
protected  Element getTextInput(Element rssRoot)
          This method exists because RSS0.90 and RSS1.0 have the 'textinput' element under the root elemment.
 boolean isMyType(Document document)
          Inspects an XML Document (JDOM) to check if it can parse it.
 WireFeed parse(Document document, boolean validate)
          Parses an XML document (JDOM Document) into a feed bean.
protected  WireFeed parseChannel(Element rssRoot)
          Parses the root element of an RSS document into a Channel bean.
protected  Image parseImage(Element rssRoot)
          Parses the root element of an RSS document looking for image information.
protected  Item parseItem(Element rssRoot, Element eItem)
          Parses an item element of an RSS document looking for item information.
protected  java.util.List parseItems(Element rssRoot)
          Parses the root element of an RSS document looking for all items information.
protected  TextInput parseTextInput(Element rssRoot)
          Parses the root element of an RSS document looking for text-input information.
protected  void validateFeed(Document document)
           
 
クラス com.sun.syndication.io.impl.BaseWireFeedParser から継承されたメソッド
extractForeignMarkup, getAttribute, getAttributeValue, getType, parseFeedModules, parseItemModules
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

RSS090Parser

public RSS090Parser()

RSS090Parser

protected RSS090Parser(java.lang.String type,
                       Namespace ns)
メソッドの詳細

isMyType

public boolean isMyType(Document document)
インタフェース 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.

パラメータ:
document - XML Document (JDOM) to check if it can be parsed by this parser.
戻り値:
true if the parser know how to parser this feed, false otherwise.

parse

public WireFeed parse(Document document,
                      boolean validate)
               throws java.lang.IllegalArgumentException,
                      FeedException
インタフェース WireFeedParser の記述:
Parses an XML document (JDOM Document) into a feed bean.

パラメータ:
document - XML document (JDOM) to parse.
validate - indicates if the feed should be strictly validated (NOT YET IMPLEMENTED).
戻り値:
the resulting feed bean.
例外:
java.lang.IllegalArgumentException - thrown if the parser cannot handle the given feed type.
FeedException - thrown if a feed bean cannot be created out of the XML document (JDOM).

validateFeed

protected void validateFeed(Document document)
                     throws FeedException
例外:
FeedException

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 the EMPTY namespace.

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 the EMPTY namespace.

getContentNamespace

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

This implementation returns the EMTPY namespace.

戻り値:
returns the EMPTY namespace.

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)

パラメータ:
rssRoot - the root element of the RSS document to parse.
戻り値:
the parsed Channel bean.

getItems

protected java.util.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.


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.


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.


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.

パラメータ:
rssRoot - the root element of the RSS document to parse for image information.
戻り値:
the parsed image bean.

parseItems

protected java.util.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.

パラメータ:
rssRoot - the root element of the RSS document to parse for all items information.
戻り値:
a list with all the parsed RSSItem beans.

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.

パラメータ:
rssRoot - the root element of the RSS document in case it's needed for context.
eItem - the item element to parse.
戻り値:
the parsed RSSItem bean.

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.

パラメータ:
rssRoot - the root element of the RSS document to parse for text-input information.
戻り値:
the parsed RSSTextInput bean.