KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > blojsom > blog > Comment


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

31 package org.blojsom.blog;
32
33 import java.util.Date JavaDoc;
34 import java.util.Map JavaDoc;
35 import java.util.Locale JavaDoc;
36
37 /**
38  * Comment
39  *
40  * @author David Czarnecki
41  * @since blojsom 3.0
42  * @version $Id: Comment.java,v 1.6 2006/09/26 02:55:21 czarneckid Exp $
43  */

44 public interface Comment extends Response {
45
46     /**
47      * Set the comment ID
48      *
49      * @param id Comment ID
50      */

51     void setId(Integer JavaDoc id);
52
53     /**
54      * Get the comment ID
55      *
56      * @return Comment ID
57      */

58     public Integer JavaDoc getId();
59
60     /**
61      * Set the blog ID
62      *
63      * @param blogId Blog ID
64      */

65     void setBlogId(Integer JavaDoc blogId);
66
67     /**
68      * Get the blog ID
69      *
70      * @return Blog ID
71      */

72     Integer JavaDoc getBlogId();
73
74     /**
75      * Get the blog entry ID
76      *
77      * @return Blog entry ID
78      */

79     public Integer JavaDoc getBlogEntryId();
80
81     /**
82      * Set the blog entry ID
83      *
84      * @param blogEntryId Blog entry ID
85      */

86     public void setBlogEntryId(Integer JavaDoc blogEntryId);
87
88     /**
89      * Get the author of the comment
90      *
91      * @return Comment author
92      */

93     String JavaDoc getAuthor();
94
95     /**
96      * Get the author as an escaped string
97      *
98      * @return Escaped author
99      */

100     String JavaDoc getEscapedAuthor();
101
102     /**
103      * Set the author of the comment
104      *
105      * @param author Comment's new author
106      */

107     void setAuthor(String JavaDoc author);
108
109     /**
110      * Get the e-mail of the author of the comment
111      *
112      * @return Author's e-mail
113      */

114     String JavaDoc getAuthorEmail();
115
116     /**
117      * Get the escaped e-mail of the author of the comment
118      *
119      * @return Escaped author e-mail
120      */

121     String JavaDoc getEscapedAuthorEmail();
122
123     /**
124      * Set the e-mail of the author of the comment
125      *
126      * @param authorEmail Author's new e-mail
127      */

128     void setAuthorEmail(String JavaDoc authorEmail);
129
130     /**
131      * Get the URL of the author
132      *
133      * @return Author's URL
134      */

135     String JavaDoc getAuthorURL();
136
137     /**
138      * Get the escaped URL of the author
139      *
140      * @return Escaped URL
141      */

142     String JavaDoc getEscapedAuthorURL();
143
144     /**
145      * Set the URL for the author
146      *
147      * @param authorURL New URL for the author
148      */

149     void setAuthorURL(String JavaDoc authorURL);
150
151     /**
152      * Get the comment as a escaped string
153      *
154      * @return Escaped Comment
155      */

156     String JavaDoc getEscapedComment();
157
158     /**
159      * Get the comment
160      *
161      * @return Comment
162      */

163     String JavaDoc getComment();
164
165     /**
166      * Set the new comment
167      *
168      * @param comment New comment
169      */

170     void setComment(String JavaDoc comment);
171
172     /**
173      * Get the date the comment was entered
174      *
175      * @return Comment date
176      */

177     Date JavaDoc getCommentDate();
178
179     /**
180      * Return an ISO 8601 style date
181      * http://www.w3.org/TR/NOTE-datetime
182      *
183      * @return Date formatted in ISO 8601 format
184      */

185     String JavaDoc getISO8601Date();
186
187     /**
188      * Return an RFC 822 style date
189      *
190      * @return Date formatted in RFC 822 format
191      */

192     String JavaDoc getRFC822Date();
193
194     /**
195      * Get the comment meta-data
196      *
197      * @return Meta-data as a {@link Map}
198      */

199     Map JavaDoc getMetaData();
200
201     /**
202      * Set the date for the comment
203      *
204      * @param commentDate Comment date
205      */

206     void setCommentDate(Date JavaDoc commentDate);
207
208     /**
209      * Set the comment meta-data
210      *
211      * @param metaData {@link Map} containing meta-data for this comment
212      */

213     void setMetaData(Map JavaDoc metaData);
214
215     /**
216      * Return the comment date formatted with a specified date format
217      *
218      * @param format Date format
219      * @return <code>null</code> if the comment date or format is null, otherwise returns the comment date
220      * formatted to the specified format. If the format is invalid, returns <tt>commentDate.toString()</tt>
221      */

222     String JavaDoc getDateAsFormat(String JavaDoc format);
223
224     /**
225      * Return the comment date formatted with a specified date format
226      *
227      * @param format Date format
228      * @param locale Locale for date formatting
229      * @return <code>null</code> if the entry date or format is null, otherwise returns the entry date formatted to the specified format. If the format is invalid, returns <tt>commentDate.toString()</tt>
230      */

231     String JavaDoc getDateAsFormat(String JavaDoc format, Locale JavaDoc locale);
232
233     /**
234      * Retrieve the {@link Entry} associated with this comment
235      *
236      * @return {@link Entry}
237      */

238     Entry getEntry();
239
240     /**
241      * Set the {@link Entry} associated with this comment
242      *
243      * @param blogEntry {@link Entry}
244      */

245     void setEntry(Entry entry);
246
247     /**
248      * Get the comment parent ID
249      *
250      * @return Comment parent ID
251      */

252     public Integer JavaDoc getParentId();
253
254     /**
255      * Set the comment parent ID
256      *
257      * @param parentId Comment parent ID
258      */

259     public void setParentId(Integer JavaDoc parentId);
260 }
261
Popular Tags