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.CopyFrom;
20  import com.sun.syndication.feed.module.Module;
21  
22  import java.util.Date;
23  import java.util.List;
24  
25  /***
26   * Bean interface for entries of SyndFeedImpl feeds.
27   * <p>
28   * @author Alejandro Abdelnur
29   *
30   */
31  public interface SyndEntry extends Cloneable,CopyFrom {
32  
33      /***
34       * Returns the entry URI.
35       * <p>
36       * How the entry URI maps to a concrete feed type (RSS or Atom) depends on
37       * the concrete feed type. This is explained in detail in Rome documentation,
38       * <a href="http://wiki.java.net/bin/edit/Javawsxml/Rome04URIMapping">Feed and entry URI mapping</a>.
39       * <p>
40       * The returned URI is a normalized URI as specified in RFC 2396bis.
41       * <p>
42       * @return the entry URI, <b>null</b> if none.
43       *
44       */
45      String getUri();
46  
47      /***
48       * Sets the entry URI.
49       * <p>
50       * How the entry URI maps to a concrete feed type (RSS or Atom) depends on
51       * the concrete feed type. This is explained in detail in Rome documentation,
52       * <a href="http://wiki.java.net/bin/edit/Javawsxml/Rome04URIMapping">Feed and entry URI mapping</a>.
53       * <p>
54       * @param uri the entry URI to set, <b>null</b> if none.
55       *
56       */
57      void setUri(String uri);
58  
59      /***
60       * Returns the entry title.
61       * <p>
62       * @return the entry title, <b>null</b> if none.
63       *
64       */
65      String getTitle();
66  
67      /***
68       * Sets the entry title.
69       * <p>
70       * @param title the entry title to set, <b>null</b> if none.
71       *
72       */
73      void setTitle(String title);
74  
75      /***
76       * Returns the entry link.
77       * <p>
78       * @return the entry link, <b>null</b> if none.
79       *
80       */
81      String getLink();
82  
83      /***
84       * Sets the entry link.
85       * <p>
86       * @param link the entry link to set, <b>null</b> if none.
87       *
88       */
89      void setLink(String link);
90  
91      /***
92       * Returns the entry links
93       * <p>
94       * @return the entry links, <b>null</b> if none.
95       *
96       */
97      List getLinks();
98  
99      /***
100      * Sets the entry links.
101      * <p>
102      * @param links the entry links to set, <b>null</b> if none.
103      *
104      */
105     void setLinks(List links);
106 
107     /***
108      * Returns the entry description.
109      * <p>
110      * @return the entry description, <b>null</b> if none.
111      *
112      */
113     SyndContent getDescription();
114 
115     /***
116      * Sets the entry description.
117      * <p>
118      * @param description the entry description to set, <b>null</b> if none.
119      *
120      */
121     void setDescription(SyndContent description);
122 
123     /***
124      * Returns the entry contents.
125      * <p>
126      * @return a list of SyndContentImpl elements with the entry contents,
127      *         an empty list if none.
128      *
129      */
130     List getContents();
131 
132     /***
133      * Sets the entry contents.
134      * <p>
135      * @param contents the list of SyndContentImpl elements with the entry contents to set,
136      *        an empty list or <b>null</b> if none.
137      *
138      */
139     void setContents(List contents);
140 
141     /***
142      * Returns the entry enclosures.
143      * <p>
144      * @return a list of SyndEnclosure elements with the entry enclosures,
145      *         an empty list if none.
146      *
147      */
148     public List getEnclosures();
149 
150     /***
151      * Sets the entry enclosures.
152      * <p>
153      * @param enclosures the list of SyndEnclosure elements with the entry enclosures to set,
154      *        an empty list or <b>null</b> if none.
155      *
156      */
157     public void setEnclosures(List enclosures);
158 
159     /***
160      * Returns the entry published date.
161      * <p>
162      * This method is a convenience method, it maps to the Dublin Core module date.
163      * <p>
164      * @return the entry published date, <b>null</b> if none.
165      *
166      */
167     Date getPublishedDate();
168 
169     /***
170      * Sets the entry published date.
171      * <p>
172      * This method is a convenience method, it maps to the Dublin Core module date.
173      * <p>
174      * @param publishedDate the entry published date to set, <b>null</b> if none.
175      *
176      */
177     void setPublishedDate(Date publishedDate);
178 
179     /***
180      * Returns the entry updated date.
181      * <p>
182      * @return the entry updated date, <b>null</b> if none.
183      *
184      */
185     Date getUpdatedDate();
186 
187     /***
188      * Sets the entry updated date.
189      * <p>
190      * @param publishedDate the entry updated date to set, <b>null</b> if none.
191      *
192      */
193     void setUpdatedDate(Date updatedDate);
194 
195     /***
196      * Returns the entry authors.
197      * <p>
198      * For Atom feeds, this returns the authors as a list of SyndPerson objects, 
199      * for RSS feeds this method is a convenience method, it maps to the 
200      * Dublin Core module creator.
201      * <p>
202      * @return the feed author, <b>null</b> if none.
203      *
204      */
205     List getAuthors();
206 
207     /***
208      * Sets the entry author.
209      * <p>
210      * For Atom feeds, this sets the authors as a list of SyndPerson 
211      * objects, for RSS feeds this method is a convenience method, it maps 
212      * to the Dublin Core module creator.
213      * <p>
214      * @param author the feed author to set, <b>null</b> if none.
215      *
216      */
217     void setAuthors(List authors);
218     
219     /***
220      * Returns the name of the first entry author in the collection of authors.
221      * <p>
222      * For Atom feeds, this returns the authors as a list of SyndPerson objects, 
223      * for RSS feeds this method is a convenience method, it maps to the 
224      * Dublin Core module creator.
225      * <p>
226      * @return the feed author, <b>null</b> if none.
227      *
228      */
229     String getAuthor();
230 
231     /***
232      * Sets the entry author.
233      * <p>
234      * For Atom feeds, this sets the feed author's name, for RSS feeds 
235      * this method is a convenience method, it maps to the Dublin Core 
236      * module creator.
237      * <p>
238      * @param author the feed author to set, <b>null</b> if none.
239      */
240     void setAuthor(String author);
241     
242     /***
243      * Returns the feed author.
244      * <p>
245      * For Atom feeds, this returns the contributors as a list of 
246      * SyndPerson objects
247      * <p>
248      * @return the feed author, <b>null</b> if none.
249      *
250      */
251     List getContributors();
252 
253     /***
254      * Sets the feed author.
255      * <p>
256      * Returns contributors as a list of SyndPerson objects.
257      * <p>
258      * @param author the feed author to set, <b>null</b> if none.
259      *
260      */
261     void setContributors(List contributors);
262 
263     /***
264      * Returns the entry categories.
265      * <p>
266      * This method is a convenience method, it maps to the Dublin Core module subjects.
267      * <p>
268      * @return a list of SyndCategoryImpl elements with the entry categories,
269      *         an empty list if none.
270      *
271      */
272     List getCategories();
273 
274     /***
275      * Sets the entry categories.
276      * <p>
277      * This method is a convenience method, it maps to the Dublin Core module subjects.
278      * <p>
279      * @param categories the list of SyndCategoryImpl elements with the entry categories to set,
280      *        an empty list or <b>null</b> if none.
281      *
282      */
283     void setCategories(List categories);
284 
285     /***
286      * Returns the module identified by a given URI.
287      * <p>
288      * @param uri the URI of the ModuleImpl.
289      * @return The module with the given URI, <b>null</b> if none.
290      */
291     public Module getModule(String uri);
292 
293     /***
294      * Returns the entry modules.
295      * <p>
296      * @return a list of ModuleImpl elements with the entry modules,
297      *         an empty list if none.
298      *
299      */
300     List getModules();
301 
302     /***
303      * Sets the entry modules.
304      * <p>
305      * @param modules the list of ModuleImpl elements with the entry modules to set,
306      *        an empty list or <b>null</b> if none.
307      *
308      */
309     void setModules(List modules);
310 
311     /***
312      * Creates a deep clone of the object.
313      * <p>
314      * @return a clone of the object.
315      * @throws CloneNotSupportedException thrown if an element of the object cannot be cloned.
316      *
317      */
318     public Object clone() throws CloneNotSupportedException;
319 
320 }