View Javadoc

1   /*
2    * Copyright 1999,2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.apache.commons.feedparser;
18  
19  
20  /**
21   *
22   * @author <a href="mailto:burton@apache.org">Kevin A. Burton (burtonator)</a>
23   * @version $Id: FeedParserListener.java 373614 2006-01-30 22:31:21Z mvdb $
24   */
25  public interface FeedParserListener extends FeedLifecycleListener {
26      
27      /**
28       * Called when a channel item is found.
29       *
30       * 
31       */
32      public void onChannel( FeedParserState state,
33                             String title,
34                             String link,
35                             String description ) throws FeedParserException;
36  
37      public void onChannelEnd() throws FeedParserException;
38  
39      /**
40       * Called when an RSS image is found.
41       *
42       * 
43       */
44      public void onImage( FeedParserState state,
45                           String title,
46                           String link,
47                           String url ) throws FeedParserException;
48  
49      public void onImageEnd() throws FeedParserException;
50      
51      /**
52       * Called when an RSS item or Atom entry is found. 
53       *
54       * 
55       */
56      public void onItem( FeedParserState state,
57                          String title,
58                          String link,
59                          String description,
60                          String permalink ) throws FeedParserException;
61  
62      public void onItemEnd() throws FeedParserException;
63  
64      /**
65       * Called when we are first able to determine the feed version for this
66       * feed.  Ideally implementations should call this BEFORE onChannel but
67       * depending on the parser infrastructure this might not be possible.
68       *
69       * Should be called before init()
70       *
71       * 
72       */
73      public void onFeedVersion( FeedVersion version ) throws FeedParserException;
74      
75  }
76