org.apache.nutch.parse.rss
Class FeedParserListenerImpl

java.lang.Object
  extended by org.apache.commons.feedparser.DefaultFeedParserListener
      extended by org.apache.nutch.parse.rss.FeedParserListenerImpl
All Implemented Interfaces:
org.apache.commons.feedparser.ContentFeedParserListener, org.apache.commons.feedparser.FeedLifecycleListener, org.apache.commons.feedparser.FeedParserListener, org.apache.commons.feedparser.MetaFeedParserListener, org.apache.commons.feedparser.ModContentFeedParserListener, org.apache.commons.feedparser.XHTMLFeedParserListener

public class FeedParserListenerImpl
extends org.apache.commons.feedparser.DefaultFeedParserListener

Version:
1.0

Feed parser listener class which builds up an RSS Channel model that can be iterated through to retrieve the parsed information.

Author:
mattmann

Constructor Summary
FeedParserListenerImpl()
           Default Constructor
 
Method Summary
 List getChannels()
           Gets a Listof RSSChannels that the listener parsed from the RSS document.
 void onChannel(org.apache.commons.feedparser.FeedParserState state, String title, String link, String description)
           Callback method when the parser encounters an RSS Channel.
 void onItem(org.apache.commons.feedparser.FeedParserState state, String title, String link, String description, String permalink)
           Callback method when the parser encounters an RSS Item.
 
Methods inherited from class org.apache.commons.feedparser.DefaultFeedParserListener
finished, getContext, init, onAuthor, onAuthorEnd, onChannelEnd, onComments, onCommentsEnd, onCommentsFeed, onCommentsFeedEnd, onContent, onContentEncoded, onContentEncodedEnd, onContentEnd, onContentItem, onContentItemEnd, onCopyright, onCopyrightEnd, onCreated, onCreatedEnd, onFeedVersion, onGenerator, onGeneratorEnd, onGUID, onGUIDEnd, onImage, onImageEnd, onIssued, onIssuedEnd, onItemEnd, onLocale, onLocaleEnd, onSubject, onSubjectEnd, onXHTMLBody, onXHTMLBodyEnd, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeedParserListenerImpl

public FeedParserListenerImpl()

Default Constructor

Method Detail

getChannels

public List getChannels()

Gets a Listof RSSChannels that the listener parsed from the RSS document.

Returns:
A Listof RSSChannels.

onChannel

public void onChannel(org.apache.commons.feedparser.FeedParserState state,
                      String title,
                      String link,
                      String description)
               throws org.apache.commons.feedparser.FeedParserException

Callback method when the parser encounters an RSS Channel.

Specified by:
onChannel in interface org.apache.commons.feedparser.FeedParserListener
Overrides:
onChannel in class org.apache.commons.feedparser.DefaultFeedParserListener
Parameters:
state - The current state of the FeedParser.
title - The title of the RSS Channel.
link - A hyperlink to the RSS Channel.
description - The description of the RSS Channel.
Throws:
org.apache.commons.feedparser.FeedParserException

onItem

public void onItem(org.apache.commons.feedparser.FeedParserState state,
                   String title,
                   String link,
                   String description,
                   String permalink)
            throws org.apache.commons.feedparser.FeedParserException

Callback method when the parser encounters an RSS Item.

Specified by:
onItem in interface org.apache.commons.feedparser.FeedParserListener
Overrides:
onItem in class org.apache.commons.feedparser.DefaultFeedParserListener
Parameters:
state - The current state of the FeedParser.
title - The title of the RSS Item.
link - A hyperlink to the RSS Item.
description - The description of the RSS Item.
permalink - A permanent link to the RSS Item.
Throws:
org.apache.commons.feedparser.FeedParserException


Copyright © 2006 The Apache Software Foundation