001 /* 002 * Copyright 1999,2004 The Apache Software Foundation. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017 package org.apache.commons.feedparser; 018 019 020 /** 021 * 022 * @author <a href="mailto:burton@apache.org">Kevin A. Burton (burtonator)</a> 023 * @version $Id: FeedParserListener.java 373614 2006-01-30 22:31:21Z mvdb $ 024 */ 025 public interface FeedParserListener extends FeedLifecycleListener { 026 027 /** 028 * Called when a channel item is found. 029 * 030 * 031 */ 032 public void onChannel( FeedParserState state, 033 String title, 034 String link, 035 String description ) throws FeedParserException; 036 037 public void onChannelEnd() throws FeedParserException; 038 039 /** 040 * Called when an RSS image is found. 041 * 042 * 043 */ 044 public void onImage( FeedParserState state, 045 String title, 046 String link, 047 String url ) throws FeedParserException; 048 049 public void onImageEnd() throws FeedParserException; 050 051 /** 052 * Called when an RSS item or Atom entry is found. 053 * 054 * 055 */ 056 public void onItem( FeedParserState state, 057 String title, 058 String link, 059 String description, 060 String permalink ) throws FeedParserException; 061 062 public void onItemEnd() throws FeedParserException; 063 064 /** 065 * Called when we are first able to determine the feed version for this 066 * feed. Ideally implementations should call this BEFORE onChannel but 067 * depending on the parser infrastructure this might not be possible. 068 * 069 * Should be called before init() 070 * 071 * 072 */ 073 public void onFeedVersion( FeedVersion version ) throws FeedParserException; 074 075 } 076