net.sourceforge.rssowl.dao.feedparser
Class FeedParser

java.lang.Object
  extended bynet.sourceforge.rssowl.dao.feedparser.AbstractFeedParser
      extended bynet.sourceforge.rssowl.dao.feedparser.FeedParser

public class FeedParser
extends AbstractFeedParser

Class to Parse a RSS XML. Supported RSS Versions are 0.91, 0.92, 1.0 (RDF) and 2.0. Also supporting Atom 0.3 and OPML 1.0 feeds.

Version:
1.1.3
Author:
Benjamin Pasero

Field Summary
static int FEED_FORMAT_ATOM_0_3
          Newsfeed format: Atom 0.3
static int FEED_FORMAT_OPML_1_0
          Newsfeed format: OPML 1.0
static int FEED_FORMAT_RDF_1_0
          Newsfeed format: RDF 1.0
static int FEED_FORMAT_RSS_0_91
          Newsfeed format: RSS 0.91
static int FEED_FORMAT_RSS_0_92
          Newsfeed format: RSS 0.92
static int FEED_FORMAT_RSS_2_0
          Newsfeed format: RSS 2.0
 
Fields inherited from class net.sourceforge.rssowl.dao.feedparser.AbstractFeedParser
content, dc, defNs, document, rdf, root, rssChannel, sy, url
 
Constructor Summary
FeedParser(org.jdom.Document document, String url)
          Instantiate a new FeedParser
 
Method Summary
private  boolean checkFeedFormat()
          Check if the given document matches RSS, RDF, Atom or OPML format
 Channel getChannel()
          Get the parsed Channel
 int getFeedFormat()
          Try to determine the newsfeed format from the document.
 void parse()
          Parse elements that are defined in the specifications and add them to the Channel.
 
Methods inherited from class net.sourceforge.rssowl.dao.feedparser.AbstractFeedParser
getAttributeValue, getAttributeValue, getChildElement, getChildElement, getChildren, getChildren, getChildValue, getChildValue, parseContentModule, parseDCModule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FEED_FORMAT_ATOM_0_3

public static final int FEED_FORMAT_ATOM_0_3
Newsfeed format: Atom 0.3

See Also:
Constant Field Values

FEED_FORMAT_OPML_1_0

public static final int FEED_FORMAT_OPML_1_0
Newsfeed format: OPML 1.0

See Also:
Constant Field Values

FEED_FORMAT_RDF_1_0

public static final int FEED_FORMAT_RDF_1_0
Newsfeed format: RDF 1.0

See Also:
Constant Field Values

FEED_FORMAT_RSS_0_91

public static final int FEED_FORMAT_RSS_0_91
Newsfeed format: RSS 0.91

See Also:
Constant Field Values

FEED_FORMAT_RSS_0_92

public static final int FEED_FORMAT_RSS_0_92
Newsfeed format: RSS 0.92

See Also:
Constant Field Values

FEED_FORMAT_RSS_2_0

public static final int FEED_FORMAT_RSS_2_0
Newsfeed format: RSS 2.0

See Also:
Constant Field Values
Constructor Detail

FeedParser

public FeedParser(org.jdom.Document document,
                  String url)
           throws NewsfeedFactoryException
Instantiate a new FeedParser

Parameters:
document - Document holding the rss xml
url - The url of the RSS XML
Throws:
NewsfeedFactoryException - If the document is not a valid Newsfeed
Method Detail

getChannel

public Channel getChannel()
Get the parsed Channel

Returns:
Channel The parsed Channel from the document

getFeedFormat

public int getFeedFormat()
Try to determine the newsfeed format from the document.

Returns:
int One of the supported newsfeed formats

parse

public void parse()
           throws NewsfeedFactoryException
Description copied from class: AbstractFeedParser
Parse elements that are defined in the specifications and add them to the Channel.

Specified by:
parse in class AbstractFeedParser
Throws:
NewsfeedFactoryException - If any error occurs
See Also:
AbstractFeedParser.parse()

checkFeedFormat

private boolean checkFeedFormat()
Check if the given document matches RSS, RDF, Atom or OPML format

Returns:
boolean TRUE if the document has a valid feed format


RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo