1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.sun.syndication.feed.atom;
18
19 import com.sun.syndication.feed.WireFeed;
20
21 import java.util.ArrayList;
22 import java.util.Date;
23 import java.util.List;
24
25 /***
26 * Bean for Atom feeds.
27 * <p>
28 * It handles Atom feeds version 0.3 without loosing any feed information.
29 * <p>
30 * @author Alejandro Abdelnur
31 *
32 */
33 public class Feed extends WireFeed {
34 private String _language;
35 private String _title;
36 private List _alternateLinks;
37 private List _otherLinks;
38 private Person _author;
39 private List _contributors;
40 private Content _tagline;
41 private String _id;
42 private Generator _generator;
43 private String _copyright;
44 private Content _info;
45 private Date _modified;
46 private List _entries;
47 private List _modules;
48
49 /***
50 * Default constructor, for bean cloning purposes only.
51 *
52 */
53 public Feed() {
54 super();
55 }
56
57 /***
58 * Feed Constructor. All properties, except the type, are set to <b>null</b>.
59 * <p>
60 * @param type the type of the Atom feed.
61 *
62 */
63 public Feed(String type) {
64 super(type);
65 }
66
67 /***
68 * Returns the feed language.
69 * <p>
70 * @return the feed language, <b>null</b> if none.
71 *
72 */
73 public String getLanguage() {
74 return _language;
75 }
76
77 /***
78 * Sets the feed language.
79 * <p>
80 * @param language the feed language to set, <b>null</b> if none.
81 *
82 */
83 public void setLanguage(String language) {
84 _language = language;
85 }
86
87 /***
88 * Returns the feed title.
89 * <p>
90 * @return the feed title, <b>null</b> if none.
91 *
92 */
93 public String getTitle() {
94 return _title;
95 }
96
97 /***
98 * Sets the feed title.
99 * <p>
100 * @param title the feed title to set, <b>null</b> if none.
101 *
102 */
103 public void setTitle(String title) {
104 _title = title;
105 }
106
107 /***
108 * Returns the feed alternate links.
109 * <p>
110 * @return a list of Link elements with the feed alternate links,
111 * an empty list if none.
112 *
113 */
114 public List getAlternateLinks() {
115 return (_alternateLinks==null) ? (_alternateLinks=new ArrayList()) : _alternateLinks;
116 }
117
118 /***
119 * Sets the feed alternate links.
120 * <p>
121 * @param alternateLinks the list of Link elements with the feed alternate links to set,
122 * an empty list or <b>null</b> if none.
123 *
124 */
125 public void setAlternateLinks(List alternateLinks) {
126 _alternateLinks = alternateLinks;
127 }
128
129 /***
130 * Returns the feed other links (non-alternate ones).
131 * <p>
132 * @return a list of Link elements with the feed other links (non-alternate ones),
133 * an empty list if none.
134 *
135 */
136 public List getOtherLinks() {
137 return (_otherLinks==null) ? (_otherLinks=new ArrayList()) : _otherLinks;
138 }
139
140 /***
141 * Sets the feed other links (non-alternate ones).
142 * <p>
143 * @param otherLinks the list of Link elements with the feed other links (non-alternate ones) to set,
144 * an empty list or <b>null</b> if none.
145 *
146 */
147 public void setOtherLinks(List otherLinks) {
148 _otherLinks = otherLinks;
149 }
150
151 /***
152 * Returns the feed author.
153 * <p>
154 * @return the feed author, <b>null</b> if none.
155 *
156 */
157 public Person getAuthor() {
158 return _author;
159 }
160
161 /***
162 * Sets the feed author.
163 * <p>
164 * @param author the feed author to set, <b>null</b> if none.
165 *
166 */
167 public void setAuthor(Person author) {
168 _author = author;
169 }
170
171 /***
172 * Returns the feed contributors.
173 * <p>
174 * @return a list of Person elements with the feed contributors,
175 * an empty list if none.
176 *
177 */
178 public List getContributors() {
179 return (_contributors==null) ? (_contributors=new ArrayList()) : _contributors;
180 }
181
182 /***
183 * Sets the feed contributors.
184 * <p>
185 * @param contributors the list of Person elements with the feed contributors to set,
186 * an empty list or <b>null</b> if none.
187 *
188 */
189 public void setContributors(List contributors) {
190 _contributors = contributors;
191 }
192
193 /***
194 * Returns the feed tag line.
195 * <p>
196 * @return the feed tag line, <b>null</b> if none.
197 *
198 */
199 public Content getTagline() {
200 return _tagline;
201 }
202
203 /***
204 * Sets the feed tagline.
205 * <p>
206 * @param tagline the feed tagline to set, <b>null</b> if none.
207 *
208 */
209 public void setTagline(Content tagline) {
210 _tagline = tagline;
211 }
212
213 /***
214 * Returns the feed ID.
215 * <p>
216 * @return the feed ID, <b>null</b> if none.
217 *
218 */
219 public String getId() {
220 return _id;
221 }
222
223 /***
224 * Sets the feed ID.
225 * <p>
226 * @param id the feed ID to set, <b>null</b> if none.
227 *
228 */
229 public void setId(String id) {
230 _id = id;
231 }
232
233 /***
234 * Returns the feed generator.
235 * <p>
236 * @return the feed generator, <b>null</b> if none.
237 *
238 */
239 public Generator getGenerator() {
240 return _generator;
241 }
242
243 /***
244 * Sets the feed generator.
245 * <p>
246 * @param generator the feed generator to set, <b>null</b> if none.
247 *
248 */
249 public void setGenerator(Generator generator) {
250 _generator = generator;
251 }
252
253 /***
254 * Returns the feed copyright.
255 * <p>
256 * @return the feed copyright, <b>null</b> if none.
257 *
258 */
259 public String getCopyright() {
260 return _copyright;
261 }
262
263 /***
264 * Sets the feed copyright.
265 * <p>
266 * @param copyright the feed copyright to set, <b>null</b> if none.
267 *
268 */
269 public void setCopyright(String copyright) {
270 _copyright = copyright;
271 }
272
273 /***
274 * Returns the feed info.
275 * <p>
276 * @return the feed info, <b>null</b> if none.
277 *
278 */
279 public Content getInfo() {
280 return _info;
281 }
282
283 /***
284 * Sets the feed info.
285 * <p>
286 * @param info the feed info to set, <b>null</b> if none.
287 *
288 */
289 public void setInfo(Content info) {
290 _info = info;
291 }
292
293 /***
294 * Returns the feed modified date.
295 * <p>
296 * @return the feed modified date, <b>null</b> if none.
297 *
298 */
299 public Date getModified() {
300 return _modified;
301 }
302
303 /***
304 * Sets the feed modified date.
305 * <p>
306 * @param modified the feed modified date to set, <b>null</b> if none.
307 *
308 */
309 public void setModified(Date modified) {
310 _modified = modified;
311 }
312
313 /***
314 * Returns the feed entries.
315 * <p>
316 * @return a list of Entry elements with the feed entries,
317 * an empty list if none.
318 *
319 */
320 public List getEntries() {
321 return (_entries==null) ? (_entries=new ArrayList()) : _entries;
322 }
323
324 /***
325 * Sets the feed entries.
326 * <p>
327 * @param entries the list of Entry elements with the feed entries to set,
328 * an empty list or <b>null</b> if none.
329 *
330 */
331 public void setEntries(List entries) {
332 _entries = entries;
333 }
334
335 /***
336 * Returns the feed modules.
337 * <p>
338 * @return a list of Module elements with the feed modules,
339 * an empty list if none.
340 *
341 */
342 public List getModules() {
343 return (_modules==null) ? (_modules=new ArrayList()) : _modules;
344 }
345
346 /***
347 * Sets the feed moduless.
348 * <p>
349 * @param modules the list of Module elements with the feed moduless to set,
350 * an empty list or <b>null</b> if none.
351 *
352 */
353 public void setModules(List modules) {
354 _modules = modules;
355 }
356
357 }
358