Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
FeedDirectoryParserListener |
|
| 1.0;1 |
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 | * <p> | |
22 | * Interface for generic feeds that support feed directory structures. These | |
23 | * are feed such as OPML and OCS that support nested feeds. This can be used | |
24 | * within two systems to exchange feed lists. | |
25 | * | |
26 | * <p> | |
27 | * This interface needs to be compatible with: | |
28 | * | |
29 | * <p> | |
30 | * | |
31 | * <dl> | |
32 | * <dt>FDML</dt> | |
33 | * <dd>http://www.intertwingly.net/wiki/fdml/</dd> | |
34 | * | |
35 | * <dt>OPML (Outline Processor Markup Language)</dt> | |
36 | * <dt>OCS (Open Content Syndication)</dt> | |
37 | * | |
38 | * <dt>XFN (XHTML Friends Network)</dt> | |
39 | * | |
40 | * </dl> | |
41 | * | |
42 | * @author <a href="mailto:burton@apache.org">Kevin A. Burton (burtonator)</a> | |
43 | * @version $Id: FeedDirectoryParserListener.java 373614 2006-01-30 22:31:21Z mvdb $ | |
44 | */ | |
45 | public interface FeedDirectoryParserListener extends FeedParserListener { | |
46 | ||
47 | /** | |
48 | * Called when an directory item is found. This is compatible with the | |
49 | * FeedParserListener so that existing implementations work. This provides | |
50 | * a mechanism to index FDML, OPML, OCS, etc with existing feed parsers. | |
51 | * | |
52 | * @param weblog The HTML URL to the root of the weblog. Example: | |
53 | * http://www.peerfear.org | |
54 | * | |
55 | * @param title The title of the feed or weblog. Maybe be null when not | |
56 | * specified. | |
57 | * | |
58 | * @param feed The XML URL to the RSS/Atom feed for this weblog. This may | |
59 | * be null in some situations when we don't have a feed URL | |
60 | * | |
61 | * @see FeedParserListener#onItem | |
62 | * | |
63 | */ | |
64 | public void onItem( FeedParserState state, | |
65 | String title, | |
66 | String weblog, | |
67 | String description, | |
68 | String feed ) throws FeedParserException; | |
69 | ||
70 | public void onItemEnd() throws FeedParserException; | |
71 | ||
72 | /** | |
73 | * Called when we've found a relation for a given item. This way you can | |
74 | * specify the relationship you have with a given entry in your directory. | |
75 | * This is mostly for compatibility purposes with XFN so that the values can | |
76 | * be 'met', 'date', 'sweetheart', 'friend'. | |
77 | * | |
78 | * For XFN we would call onItem() methods and then onRelation() methods with | |
79 | * each of the relations passed. | |
80 | * | |
81 | * | |
82 | */ | |
83 | public void onRelation( FeedParserState state, | |
84 | String value ); | |
85 | ||
86 | public void onRelationEnd(); | |
87 | ||
88 | /** | |
89 | * Called when a new Folder is found. If feeds are in the default root | |
90 | * folder this method is not called. This is mostly for OPML support but | |
91 | * could be used within other feed formats. When this method isn't called | |
92 | * one could assume that items are in the 'root' folder or no folder. | |
93 | * | |
94 | * | |
95 | */ | |
96 | public void onFolder( FeedParserState state, | |
97 | String name ) throws FeedParserException; | |
98 | ||
99 | public void onFolderEnd() throws FeedParserException; | |
100 | ||
101 | } | |
102 |