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  import org.jdom.*;
20  
21  /***
22   *
23   * @author <a href="mailto:burton@apache.org">Kevin A. Burton (burtonator)</a>
24   * @version $Id: FeedParserListener.java 159212 2005-03-27 23:31:07Z burton $
25   */
26  public interface FeedParserListener extends FeedLifecycleListener {
27      
28      /***
29       * Called when a channel item is found.
30       *
31       * 
32       */
33      public void onChannel( FeedParserState state,
34                             String title,
35                             String link,
36                             String description ) throws FeedParserException;
37  
38      public void onChannelEnd() throws FeedParserException;
39  
40      /***
41       * Called when an RSS image is found.
42       *
43       * 
44       */
45      public void onImage( FeedParserState state,
46                           String title,
47                           String link,
48                           String url ) throws FeedParserException;
49  
50      public void onImageEnd() throws FeedParserException;
51      
52      /***
53       * Called when an RSS item or Atom entry is found. 
54       *
55       * 
56       */
57      public void onItem( FeedParserState state,
58                          String title,
59                          String link,
60                          String description,
61                          String permalink ) throws FeedParserException;
62  
63      public void onItemEnd() throws FeedParserException;
64  
65      /***
66       * Called when we are first able to determine the feed version for this
67       * feed.  Ideally implementations should call this BEFORE onChannel but
68       * depending on the parser infrastructure this might not be possible.
69       *
70       * Should be called before init()
71       *
72       * 
73       */
74      public void onFeedVersion( FeedVersion version ) throws FeedParserException;
75      
76  }
77