View Javadoc

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.WireFeed;
20  import com.sun.syndication.common.ToString;
21  
22  import java.util.Date;
23  import java.util.List;
24  
25  /***
26   * Bean interface for all types of feeds.
27   * <p>
28   * It handles all RSS versions and Atom 0.3, it normalizes all info, it may lose information.
29   * <p>
30   * @author Alejandro Abdelnur
31   *
32   */
33  public interface SyndFeedI extends ToString,Cloneable {
34  
35      /***
36       * Returns the real feed types the SyndFeed supports when converting from and to.
37       * <p>
38       * @return the real feed type supported.
39       */
40      List getSupportedFeedTypes();
41  
42      /***
43       * Creates a rea feed containing the information of the SyndFeed.
44       * <p>
45       * The feed type of the created WireFeed is taken from the SyndFeed feedType property.
46       * <p>
47       * @return the real feed.
48       *
49       */
50      WireFeed createWireFeed();
51  
52      /***
53       * Creates a real feed containing the information of the SyndFeed.
54       * <p>
55       * @param feedType the feed type for the WireFeed to be created.
56       * @return the real feed.
57       *
58       */
59      WireFeed createWireFeed(String feedType);
60  
61  
62      /***
63       * Returns the wire feed type the feed had/will-have when coverted from/to a WireFeed.
64       * <p>
65       * @return the feed type, <b>null</b> if none.
66       *
67       */
68      String getFeedType();
69  
70      /***
71       * Sets the wire feed type the feed will-have when coverted to a WireFeed.
72       * <p>
73       * @param feedType the feed type to set, <b>null</b> if none.
74       *
75       */
76      void setFeedType(String feedType);
77  
78  
79      /***
80       * Returns the feed title.
81       * <p>
82       * @return the feed title, <b>null</b> if none.
83       *
84       */
85      String getTitle();
86  
87      /***
88       * Sets the feed title.
89       * <p>
90       * @param title the feed title to set, <b>null</b> if none.
91       *
92       */
93      void setTitle(String title);
94  
95      /***
96       * Returns the feed link.
97       * <p>
98       * @return the feed link, <b>null</b> if none.
99       *
100      */
101     String getLink();
102 
103     /***
104      * Sets the feed link.
105      * <p>
106      * @param link the feed link to set, <b>null</b> if none.
107      *
108      */
109     void setLink(String link);
110 
111     /***
112      * Returns the feed description.
113      * <p>
114      * @return the feed description, <b>null</b> if none.
115      *
116      */
117     String getDescription();
118 
119     /***
120      * Sets the feed description.
121      * <p>
122      * @param description the feed description to set, <b>null</b> if none.
123      *
124      */
125     void setDescription(String description);
126 
127     /***
128      * Returns the feed published date.
129      * <p>
130      * This method is a convenience method, it maps to the Dublin Core module date.
131      * <p>
132      * @return the feed published date, <b>null</b> if none.
133      *
134      */
135     Date getPublishedDate();
136 
137     /***
138      * Sets the feed published date.
139      * <p>
140      * This method is a convenience method, it maps to the Dublin Core module date.
141      * <p>
142      * @param publishedDate the feed published date to set, <b>null</b> if none.
143      *
144      */
145     void setPublishedDate(Date publishedDate);
146 
147     /***
148      * Returns the feed author.
149      * <p>
150      * This method is a convenience method, it maps to the Dublin Core module creator.
151      * <p>
152      * @return the feed author, <b>null</b> if none.
153      *
154      */
155     String getAuthor();
156 
157     /***
158      * Sets the feed author.
159      * <p>
160      * This method is a convenience method, it maps to the Dublin Core module creator.
161      * <p>
162      * @param author the feed author to set, <b>null</b> if none.
163      *
164      */
165     void setAuthor(String author);
166 
167     /***
168      * Returns the feed copyright.
169      * <p>
170      * This method is a convenience method, it maps to the Dublin Core module rights.
171      * <p>
172      * @return the feed copyright, <b>null</b> if none.
173      *
174      */
175     String getCopyright();
176 
177     /***
178      * Sets the feed copyright.
179      * <p>
180      * This method is a convenience method, it maps to the Dublin Core module rights.
181      * <p>
182      * @param copyright the feed copyright to set, <b>null</b> if none.
183      *
184      */
185     void setCopyright(String copyright);
186 
187     /***
188      * Returns the feed image.
189      * <p>
190      * @return the feed image, <b>null</b> if none.
191      *
192      */
193     SyndImageI getImage();
194 
195     /***
196      * Sets the feed image.
197      * <p>
198      * @param image the feed image to set, <b>null</b> if none.
199      *
200      */
201     void setImage(SyndImageI image);
202 
203     /***
204      * Returns the feed categories.
205      * <p>
206      * This method is a convenience method, it maps to the Dublin Core module subjects.
207      * <p>
208      * @return a list of SyndCategory elements with the feed categories,
209      *         an empty list if none.
210      *
211      */
212     List getCategories();
213 
214     /***
215      * Sets the feed categories.
216      * <p>
217      * This method is a convenience method, it maps to the Dublin Core module subjects.
218      * <p>
219      * @param categories the list of SyndCategory elements with the feed categories to set,
220      *        an empty list or <b>null</b> if none.
221      *
222      */
223     void setCategories(List categories);
224 
225     /***
226      * Returns the feed entries.
227      * <p>
228      * @return a list of SyndEntry elements with the feed entries,
229      *         an empty list if none.
230      *
231      */
232     List getEntries();
233 
234     /***
235      * Sets the feed entries.
236      * <p>
237      * @param entries the list of SyndEntry elements with the feed entries to set,
238      *        an empty list or <b>null</b> if none.
239      *
240      */
241     void setEntries(List entries);
242 
243     /***
244      * Returns the feed language.
245      * <p>
246      * This method is a convenience method, it maps to the Dublin Core module language.
247      * <p>
248      * @return the feed language, <b>null</b> if none.
249      *
250      */
251     String getLanguage();
252 
253     /***
254      * Sets the feed language.
255      * <p>
256      * This method is a convenience method, it maps to the Dublin Core module language.
257      * <p>
258      * @param language the feed language to set, <b>null</b> if none.
259      *
260      */
261     void setLanguage(String language);
262 
263     /***
264      * Returns the feed modules.
265      * <p>
266      * @return a list of Module elements with the feed modules,
267      *         an empty list if none.
268      *
269      */
270     List getModules();
271 
272     /***
273      * Sets the feed modules.
274      * <p>
275      * @param modules the list of Module elements with the feed modules to set,
276      *        an empty list or <b>null</b> if none.
277      *
278      */
279     void setModules(List modules);
280 
281     /***
282      * Creates a deep clone of the object.
283      * <p>
284      * @return a clone of the object.
285      * @throws CloneNotSupportedException thrown if an element of the object cannot be cloned.
286      *
287      */
288     public Object clone() throws CloneNotSupportedException;
289 
290 }