KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > jforum > util > rss > RSSItem


1 /*
2  * Copyright (c) 2003, Rafael Steil
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms,
6  * with or without modification, are permitted provided
7  * that the following conditions are met:
8  *
9  * 1) Redistributions of source code must retain the above
10  * copyright notice, this list of conditions and the
11  * following disclaimer.
12  * 2) Redistributions in binary form must reproduce the
13  * above copyright notice, this list of conditions and
14  * the following disclaimer in the documentation and/or
15  * other materials provided with the distribution.
16  * 3) Neither the name of "Rafael Steil" nor
17  * the names of its contributors may be used to endorse
18  * or promote products derived from this software without
19  * specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
22  * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
23  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
24  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
27  * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
28  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
32  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
34  * IN CONTRACT, STRICT LIABILITY, OR TORT
35  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
36  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
37  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
38  *
39  * Created on 20/10/2004 22:58:48
40  * The JForum Project
41  * http://www.jforum.net
42  */

43 package net.jforum.util.rss;
44
45 import java.util.ArrayList JavaDoc;
46 import java.util.List JavaDoc;
47
48 /**
49  * Represents a single RSS piece of content.
50  *
51  * @author Rafael Steil
52  * @version $Id: RSSItem.java,v 1.8 2005/07/26 03:04:37 rafaelsteil Exp $
53  */

54 public class RSSItem
55 {
56     private String JavaDoc author;
57     private String JavaDoc link;
58     private String JavaDoc title;
59     private String JavaDoc description;
60     private String JavaDoc contentType;
61     private String JavaDoc publishDate;
62     private List JavaDoc categories;
63     
64     public RSSItem()
65     {
66         this.categories = new ArrayList JavaDoc();
67     }
68     
69     /**
70      * Gets the item's author
71      * @return
72      */

73     public String JavaDoc getAuthor()
74     {
75         return this.author;
76     }
77     
78     /**
79      * Sets the item's author
80      * @param author
81      */

82     public void setAuthor(String JavaDoc author)
83     {
84         this.author = author;
85     }
86     
87     /**
88      * Gets the document's description content-type
89      * @return The content-type, generally represented by
90      * <code>text/html</code> or <code>text/plain</code>
91      */

92     public String JavaDoc getContentType()
93     {
94         return this.contentType;
95     }
96     
97     /**
98      * Sets the document's description content-type
99      * @param contentType <code>text/html</code> or <code>text/plain</code>
100      */

101     public void setContentType(String JavaDoc contentType)
102     {
103         this.contentType = contentType;
104     }
105
106     /**
107      * Gets the document's description
108      * @return
109      */

110     public String JavaDoc getDescription()
111     {
112         return this.description;
113     }
114     
115     /**
116      * Sets the document description
117      * @param description
118      */

119     public void setDescription(String JavaDoc description)
120     {
121         this.description = description;
122     }
123     
124     /**
125      * Getst the document's link
126      * @return
127      */

128     public String JavaDoc getLink()
129     {
130         return this.link;
131     }
132     
133     /**
134      * Sets the document's link
135      * @param link
136      */

137     public void setLink(String JavaDoc link)
138     {
139         this.link = link;
140     }
141     
142     /**
143      * Gets the document's title
144      * @return
145      */

146     public String JavaDoc getTitle()
147     {
148         return this.title;
149     }
150     
151     /**
152      * Sets the document's the title
153      * @param title
154      */

155     public void setTitle(String JavaDoc title)
156     {
157         this.title = title;
158     }
159     
160     /**
161      * Sets the content publication date and time
162      * @param date
163      */

164     public void setPublishDate(String JavaDoc date)
165     {
166         this.publishDate = date;
167     }
168     
169     /**
170      * Gets the document publication date
171      * @return
172      */

173     public String JavaDoc getPublishDate()
174     {
175         return this.publishDate;
176     }
177     
178     /**
179      * Associated a new category to this item.
180      * It is possible to assiciate multiple categories to
181      * each item
182      * @param category The category name
183      */

184     public void addCategory(String JavaDoc category)
185     {
186         this.categories.add(category);
187     }
188     
189     /**
190      * Gets the categories for this item
191      * @return
192      */

193     public List JavaDoc getCategories()
194     {
195         return this.categories;
196     }
197 }
198
Popular Tags