KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > syndication > feed > synd > SyndFeed


1 /*
2  * Copyright 2004 Sun Microsystems, Inc.
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 com.sun.syndication.feed.synd;
18
19 import com.sun.syndication.feed.CopyFrom;
20 import com.sun.syndication.feed.WireFeed;
21 import com.sun.syndication.feed.module.Module;
22
23 import java.util.Date JavaDoc;
24 import java.util.List JavaDoc;
25
26 /**
27  * Bean interface for all types of feeds.
28  * <p>
29  * It handles all RSS versions and Atom 0.3, it normalizes all info, it may lose information.
30  * <p>
31  * @author Alejandro Abdelnur
32  *
33  */

34 public interface SyndFeed extends Cloneable JavaDoc,CopyFrom {
35
36     /**
37      * Returns the real feed types the SyndFeedImpl supports when converting from and to.
38      * <p>
39      * @return the real feed type supported.
40      */

41     List JavaDoc getSupportedFeedTypes();
42
43     /**
44      * Creates a real feed containing the information of the SyndFeedImpl.
45      * <p>
46      * The feed type of the created WireFeed is taken from the SyndFeedImpl feedType property.
47      * <p>
48      * @return the real feed.
49      *
50      */

51     WireFeed createWireFeed();
52
53     /**
54      * Creates a real feed containing the information of the SyndFeedImpl.
55      * <p>
56      * @param feedType the feed type for the WireFeed to be created.
57      * @return the real feed.
58      *
59      */

60     WireFeed createWireFeed(String JavaDoc feedType);
61
62
63     /**
64      * Returns the wire feed type the feed had/will-have when coverted from/to a WireFeed.
65      * <p>
66      * @return the feed type, <b>null</b> if none.
67      *
68      */

69     String JavaDoc getFeedType();
70
71     /**
72      * Sets the wire feed type the feed will-have when coverted to a WireFeed.
73      * <p>
74      * @param feedType the feed type to set, <b>null</b> if none.
75      *
76      */

77     void setFeedType(String JavaDoc feedType);
78
79     /**
80      * Returns the charset encoding of a the feed. This is not set by Rome parsers.
81      * <p>
82      * @return the charset encoding of the feed.
83      *
84      */

85     public String JavaDoc getEncoding();
86
87     /**
88      * Sets the charset encoding of a the feed. This is not set by Rome parsers.
89      * <p>
90      * @param encoding the charset encoding of the feed.
91      *
92      */

93     public void setEncoding(String JavaDoc encoding);
94
95     /**
96      * Returns the feed URI.
97      * <p>
98      * How the feed URI maps to a concrete feed type (RSS or Atom) depends on
99      * the concrete feed type. This is explained in detail in Rome documentation,
100      * <a HREF="http://wiki.java.net/bin/edit/Javawsxml/Rome04URIMapping">Feed and entry URI mapping</a>.
101      * <p>
102      * The returned URI is a normalized URI as specified in RFC 2396bis.
103      * <p>
104      * @return the feed URI, <b>null</b> if none.
105      *
106      */

107     String JavaDoc getUri();
108
109     /**
110      * Sets the feed URI.
111      * <p>
112      * How the feed URI maps to a concrete feed type (RSS or Atom) depends on
113      * the concrete feed type. This is explained in detail in Rome documentation,
114      * <a HREF="http://wiki.java.net/bin/edit/Javawsxml/Rome04URIMapping">Feed and entry URI mapping</a>.
115      * <p>
116      * @param uri the feed URI to set, <b>null</b> if none.
117      *
118      */

119     void setUri(String JavaDoc uri);
120
121     /**
122      * Returns the feed title.
123      * <p>
124      * @return the feed title, <b>null</b> if none.
125      *
126      */

127     String JavaDoc getTitle();
128
129     /**
130      * Sets the feed title.
131      * <p>
132      * @param title the feed title to set, <b>null</b> if none.
133      *
134      */

135     void setTitle(String JavaDoc title);
136
137     /**
138      * Returns the feed link.
139      * <p>
140      * @return the feed link, <b>null</b> if none.
141      *
142      */

143     String JavaDoc getLink();
144
145     /**
146      * Sets the feed link.
147      * <p>
148      * @param link the feed link to set, <b>null</b> if none.
149      *
150      */

151     void setLink(String JavaDoc link);
152
153     /**
154      * Returns the feed description.
155      * <p>
156      * @return the feed description, <b>null</b> if none.
157      *
158      */

159     String JavaDoc getDescription();
160
161     /**
162      * Sets the feed description.
163      * <p>
164      * @param description the feed description to set, <b>null</b> if none.
165      *
166      */

167     void setDescription(String JavaDoc description);
168
169     /**
170      * Returns the feed published date.
171      * <p>
172      * This method is a convenience method, it maps to the Dublin Core module date.
173      * <p>
174      * @return the feed published date, <b>null</b> if none.
175      *
176      */

177     Date JavaDoc getPublishedDate();
178
179     /**
180      * Sets the feed published date.
181      * <p>
182      * This method is a convenience method, it maps to the Dublin Core module date.
183      * <p>
184      * @param publishedDate the feed published date to set, <b>null</b> if none.
185      *
186      */

187     void setPublishedDate(Date JavaDoc publishedDate);
188
189     /**
190      * Returns the feed author.
191      * <p>
192      * This method is a convenience method, it maps to the Dublin Core module creator.
193      * <p>
194      * @return the feed author, <b>null</b> if none.
195      *
196      */

197     String JavaDoc getAuthor();
198
199     /**
200      * Sets the feed author.
201      * <p>
202      * This method is a convenience method, it maps to the Dublin Core module creator.
203      * <p>
204      * @param author the feed author to set, <b>null</b> if none.
205      *
206      */

207     void setAuthor(String JavaDoc author);
208
209     /**
210      * Returns the feed copyright.
211      * <p>
212      * This method is a convenience method, it maps to the Dublin Core module rights.
213      * <p>
214      * @return the feed copyright, <b>null</b> if none.
215      *
216      */

217     String JavaDoc getCopyright();
218
219     /**
220      * Sets the feed copyright.
221      * <p>
222      * This method is a convenience method, it maps to the Dublin Core module rights.
223      * <p>
224      * @param copyright the feed copyright to set, <b>null</b> if none.
225      *
226      */

227     void setCopyright(String JavaDoc copyright);
228
229     /**
230      * Returns the feed image.
231      * <p>
232      * @return the feed image, <b>null</b> if none.
233      *
234      */

235     SyndImage getImage();
236
237     /**
238      * Sets the feed image.
239      * <p>
240      * @param image the feed image to set, <b>null</b> if none.
241      *
242      */

243     void setImage(SyndImage image);
244
245     /**
246      * Returns the feed categories.
247      * <p>
248      * This method is a convenience method, it maps to the Dublin Core module subjects.
249      * <p>
250      * @return a list of SyndCategoryImpl elements with the feed categories,
251      * an empty list if none.
252      *
253      */

254     List JavaDoc getCategories();
255
256     /**
257      * Sets the feed categories.
258      * <p>
259      * This method is a convenience method, it maps to the Dublin Core module subjects.
260      * <p>
261      * @param categories the list of SyndCategoryImpl elements with the feed categories to set,
262      * an empty list or <b>null</b> if none.
263      *
264      */

265     void setCategories(List JavaDoc categories);
266
267     /**
268      * Returns the feed entries.
269      * <p>
270      * @return a list of SyndEntryImpl elements with the feed entries,
271      * an empty list if none.
272      *
273      */

274     List JavaDoc getEntries();
275
276     /**
277      * Sets the feed entries.
278      * <p>
279      * @param entries the list of SyndEntryImpl elements with the feed entries to set,
280      * an empty list or <b>null</b> if none.
281      *
282      */

283     void setEntries(List JavaDoc entries);
284
285     /**
286      * Returns the feed language.
287      * <p>
288      * This method is a convenience method, it maps to the Dublin Core module language.
289      * <p>
290      * @return the feed language, <b>null</b> if none.
291      *
292      */

293     String JavaDoc getLanguage();
294
295     /**
296      * Sets the feed language.
297      * <p>
298      * This method is a convenience method, it maps to the Dublin Core module language.
299      * <p>
300      * @param language the feed language to set, <b>null</b> if none.
301      *
302      */

303     void setLanguage(String JavaDoc language);
304
305     /**
306      * Returns the module identified by a given URI.
307      * <p>
308      * @param uri the URI of the ModuleImpl.
309      * @return The module with the given URI, <b>null</b> if none.
310      */

311     public Module getModule(String JavaDoc uri);
312
313     /**
314      * Returns the feed modules.
315      * <p>
316      * @return a list of ModuleImpl elements with the feed modules,
317      * an empty list if none.
318      *
319      */

320     List JavaDoc getModules();
321
322     /**
323      * Sets the feed modules.
324      * <p>
325      * @param modules the list of ModuleImpl elements with the feed modules to set,
326      * an empty list or <b>null</b> if none.
327      *
328      */

329     void setModules(List JavaDoc modules);
330
331     /**
332      * Creates a deep clone of the object.
333      * <p>
334      * @return a clone of the object.
335      * @throws CloneNotSupportedException thrown if an element of the object cannot be cloned.
336      *
337      */

338     public Object JavaDoc clone() throws CloneNotSupportedException JavaDoc;
339
340 }
341
Popular Tags