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.atom;
18  
19  import com.sun.syndication.common.ObjectBean;
20  import com.sun.syndication.feed.module.ModuleI;
21  import com.sun.syndication.feed.module.impl.ModuleUtils;
22  
23  import java.util.ArrayList;
24  import java.util.Date;
25  import java.util.List;
26  
27  /***
28   * Bean for entry elements of Atom feeds.
29   * <p>
30   * @author Alejandro Abdelnur
31   *
32   */
33  public class Entry extends ObjectBean {
34      private String _title;
35      private List _alternateLinks;
36      private List _otherLinks;
37      private Person _author;
38      private List _contributors;
39      private String _id;
40      private Date _modified;
41      private Date _issued;
42      private Date _created;
43      private Content _summary;
44      private List _contents;
45      private List _modules;
46  
47      /***
48       * Default constructor. All properties are set to <b>null</b>.
49       * <p>
50       *
51       */
52      public Entry() {
53          super(Entry.class);
54      }
55  
56      /***
57       * Returns the entry title.
58       * <p>
59       * @return the entry title, <b>null</b> if none.
60       *
61       */
62      public String getTitle() {
63          return _title;
64      }
65  
66      /***
67       * Sets the entry title.
68       * <p>
69       * @param title the entry title, <b>null</b> if none.
70       *
71       */
72      public void setTitle(String title) {
73          _title = title;
74      }
75  
76      /***
77       * Returns the entry alternate links.
78       * <p>
79       * @return a list of Link elements with the entry alternate links, an empty list if none.
80       *
81       */
82      public List getAlternateLinks() {
83          return (_alternateLinks==null) ? (_alternateLinks=new ArrayList()) : _alternateLinks;
84      }
85  
86      /***
87       * Sets the entry alternate links.
88       * <p>
89       * @param alternateLinks the list of Link elements with the entry alternate links to set,
90       *        an empty list or <b>null</b> if none.
91       *
92       */
93      public void setAlternateLinks(List alternateLinks) {
94          _alternateLinks = alternateLinks;
95      }
96  
97      /***
98       * Returns the entry non-alternate links.
99       * <p>
100      * @return the list of Link elements with the entry non-alternate links to set,
101      *         an empty list if none.
102      *
103      */
104     public List getOtherLinks() {
105         return (_otherLinks==null) ? (_otherLinks=new ArrayList()) : _otherLinks;
106     }
107 
108     /***
109      * Sets the entry non-alternate links.
110      * <p>
111      * @param otherLinks the list Link elements with the entry non-alternate links to set,
112      *        an empty list or <b>null</b> if none.
113      *
114      */
115     public void setOtherLinks(List otherLinks) {
116         _otherLinks = otherLinks;
117     }
118 
119     /***
120      * Returns the entry author.
121      * <p>
122      * @return the entry author, <b>null</b> if none.
123      *
124      */
125     public Person getAuthor() {
126         return _author;
127     }
128 
129     /***
130      * Sets the author of the entry.
131      * <p>
132      * @param author the author of the entry, <b>null</b> if none.
133      *
134      */
135     public void setAuthor(Person author) {
136         _author = author;
137     }
138 
139     /***
140      * Returns the entry contributors.
141      * <p>
142      * @return a list of Person elements with the entry contributors,
143      *         an empty list if none.
144      *
145      */
146     public List getContributors() {
147         return (_contributors==null) ? (_contributors=new ArrayList()) : _contributors;
148     }
149 
150     /***
151      * Sets the entry contributors.
152      * <p>
153      * @param contributors the list of Person elements with the entry contributors to set,
154      *        an empty list or <b>null</b> if none.
155      *
156      */
157     public void setContributors(List contributors) {
158         _contributors = contributors;
159     }
160 
161     /***
162      * Returns the entry ID.
163      * <p>
164      * @return the entry ID, <b>null</b> if none.
165      *
166      */
167     public String getId() {
168         return _id;
169     }
170 
171     /***
172      * Sets the entry ID.
173      * <p>
174      * @param id the entry ID, <b>null</b> if none.
175      *
176      */
177     public void setId(String id) {
178         _id = id;
179     }
180 
181     /***
182      * Returns the entry modified date.
183      * <p>
184      * @return the entry modified date, <b>null</b> if none.
185      *
186      */
187     public Date getModified() {
188         return _modified;
189     }
190 
191     /***
192      * Sets the entry modified date.
193      * <p>
194      * @param modified the entry modified date, <b>null</b> if none.
195      *
196      */
197     public void setModified(Date modified) {
198         _modified = modified;
199     }
200 
201     /***
202      * Returns the entry issued date.
203      * <p>
204      * @return the entry issued date, <b>null</b> if none.
205      *
206      */
207     public Date getIssued() {
208         return _issued;
209     }
210 
211     /***
212      * Sets the entry issued date.
213      * <p>
214      * @param issued the entry issued date, <b>null</b> if none.
215      *
216      */
217     public void setIssued(Date issued) {
218         _issued = issued;
219     }
220 
221     /***
222      * Returns the entry created date.
223      * <p>
224      * @return the entry created date, <b>null</b> if none.
225      *
226      */
227     public Date getCreated() {
228         return _created;
229     }
230 
231     /***
232      * Sets the entry created date.
233      * <p>
234      * @param created the entry created date, <b>null</b> if none.
235      *
236      */
237     public void setCreated(Date created) {
238         _created = created;
239     }
240 
241     /***
242      * Returns the entry summary.
243      * <p>
244      * @return  the entry summary, <b>null</b> if none.
245      *
246      */
247     public Content getSummary() {
248         return _summary;
249     }
250 
251     /***
252      * Sets the entry summary.
253      * <p>
254      * @param summary the entry summary, <b>null</b> if none.
255      *
256      */
257     public void setSummary(Content summary) {
258         _summary = summary;
259     }
260 
261     /***
262      * Returns the entry contents.
263      * <p>
264      * @return a list of Content elements with the entry contents,
265      *         an empty list if none.
266      *
267      */
268     public List getContents() {
269         return (_contents==null) ? (_contents=new ArrayList()) : _contents;
270     }
271 
272     /***
273      * Sets the entry contents.
274      * <p>
275      * @param contents the list of Content elements with the entry contents to set,
276      *        an empty list or <b>null</b> if none.
277      *
278      */
279     public void setContents(List contents) {
280         _contents = contents;
281     }
282 
283     /***
284      * Returns the entry modules.
285      * <p>
286      * @return a list of Module elements with the entry modules,
287      *         an emtpy list if none.
288      *
289      */
290     public List getModules() {
291         return (_modules==null) ? (_modules=new ArrayList()) : _modules;
292     }
293 
294     /***
295      * Sets the entry modules.
296      * <p>
297      * @param modules the list of Module elements with the entry modules to set,
298      *        an empty list or <b>null</b> if none.
299      *
300      */
301     public void setModules(List modules) {
302         _modules = modules;
303     }
304 
305     /***
306      * Returns the module identified by a given URI.
307      * <p>
308      * @param uri the URI of the Module.
309      * @return The module with the given URI, <b>null</b> if none.
310      */
311     public ModuleI getModule(String uri) {
312         return ModuleUtils.getModule(_modules,uri);
313     }
314 
315 }