org.blojsom.blog
Class BlogComment

java.lang.Object
  extended byorg.blojsom.blog.BlogComment
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
FileBackedBlogComment

public abstract class BlogComment
extends java.lang.Object
implements java.io.Serializable

BlogComment

Version:
$Id: BlogComment.java,v 1.16 2006/03/02 16:57:18 czarneckid Exp $
Author:
David Czarnecki
See Also:
Serialized Form

Field Summary
protected  java.lang.String _author
           
protected  java.lang.String _authorEmail
           
protected  java.lang.String _authorURL
           
protected  BlogEntry _blogEntry
           
protected  java.lang.String _comment
           
protected  java.util.Date _commentDate
           
protected  long _commentDateLong
           
protected  java.lang.String _id
           
protected  java.util.Map _metaData
           
 
Constructor Summary
BlogComment()
          Default constructor
 
Method Summary
abstract  void delete(BlogUser blogUser)
          Delete the blog comment
 java.lang.String getAuthor()
          Get the author of the comment
 java.lang.String getAuthorEmail()
          Get the e-mail of the author of the comment
 java.lang.String getAuthorURL()
          Get the URL of the author
 BlogEntry getBlogEntry()
          Retrieve the BlogEntry associated with this comment
 java.lang.String getComment()
          Get the comment
 java.util.Date getCommentDate()
          Get the date the comment was entered
 long getCommentDateLong()
          Get the date of this comment as a Long.
 java.lang.String getDateAsFormat(java.lang.String format)
          Return the comment date formatted with a specified date format
 java.lang.String getDateAsFormat(java.lang.String format, java.util.Locale locale)
          Return the comment date formatted with a specified date format
 java.lang.String getEscapedComment()
          Get the comment as a escaped string
 java.lang.String getId()
          Get the id of this blog comments
 java.lang.String getISO8601Date()
          Return an ISO 8601 style date http://www.w3.org/TR/NOTE-datetime
 java.util.Map getMetaData()
          Get the trackback meta-data
 java.lang.String getRFC822Date()
          Return an RFC 822 style date
abstract  void load(BlogUser blogUser)
          Load the blog comment
abstract  void save(BlogUser blogUser)
          Save the blog comment
 void setAuthor(java.lang.String author)
          Set the author of the comment
 void setAuthorEmail(java.lang.String authorEmail)
          Set the e-mail of the author of the comment
 void setAuthorURL(java.lang.String authorURL)
          Set the URL for the author
 void setBlogEntry(BlogEntry blogEntry)
          Set the BlogEntry associated with this comment
 void setComment(java.lang.String comment)
          Set the new comment
 void setCommentDate(java.util.Date commentDate)
          Set the date for the comment
 void setCommentDateLong(long commentDateLong)
          Set the Comment Date as a Long
 void setId(java.lang.String id)
          Set the id of this blog comment.
 void setMetaData(java.util.Map metaData)
          Set the trackback meta-data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_author

protected java.lang.String _author

_authorEmail

protected java.lang.String _authorEmail

_authorURL

protected java.lang.String _authorURL

_comment

protected java.lang.String _comment

_commentDate

protected java.util.Date _commentDate

_commentDateLong

protected long _commentDateLong

_id

protected java.lang.String _id

_metaData

protected java.util.Map _metaData

_blogEntry

protected BlogEntry _blogEntry
Constructor Detail

BlogComment

public BlogComment()
Default constructor

Method Detail

getAuthor

public java.lang.String getAuthor()
Get the author of the comment

Returns:
Comment author

setAuthor

public void setAuthor(java.lang.String author)
Set the author of the comment

Parameters:
author - Comment's new author

getAuthorEmail

public java.lang.String getAuthorEmail()
Get the e-mail of the author of the comment

Returns:
Author's e-mail

setAuthorEmail

public void setAuthorEmail(java.lang.String authorEmail)
Set the e-mail of the author of the comment

Parameters:
authorEmail - Author's new e-mail

getAuthorURL

public java.lang.String getAuthorURL()
Get the URL of the author

Returns:
Author's URL

setAuthorURL

public void setAuthorURL(java.lang.String authorURL)
Set the URL for the author

Parameters:
authorURL - New URL for the author

getEscapedComment

public java.lang.String getEscapedComment()
Get the comment as a escaped string

Returns:
Escaped Comment

getComment

public java.lang.String getComment()
Get the comment

Returns:
Comment

setComment

public void setComment(java.lang.String comment)
Set the new comment

Parameters:
comment - New comment

getCommentDate

public java.util.Date getCommentDate()
Get the date the comment was entered

Returns:
Comment date

getISO8601Date

public java.lang.String getISO8601Date()
Return an ISO 8601 style date http://www.w3.org/TR/NOTE-datetime

Returns:
Date formatted in ISO 8601 format

getRFC822Date

public java.lang.String getRFC822Date()
Return an RFC 822 style date

Returns:
Date formatted in RFC 822 format

getMetaData

public java.util.Map getMetaData()
Get the trackback meta-data

Returns:
Meta-data as a Map
Since:
blojsom 2.14

setCommentDate

public void setCommentDate(java.util.Date commentDate)
Set the date for the comment

Parameters:
commentDate - Comment date

getCommentDateLong

public long getCommentDateLong()
Get the date of this comment as a Long. Used for Last-Modified

Returns:
the comment date as a Long

setCommentDateLong

public void setCommentDateLong(long commentDateLong)
Set the Comment Date as a Long

Parameters:
commentDateLong - the comment file's lastModified()

getId

public java.lang.String getId()
Get the id of this blog comments

Returns:
Id
Since:
blojsom 2.07

setId

public void setId(java.lang.String id)
Set the id of this blog comment. This method can only be called if the id has not been set.

Parameters:
id - New id
Since:
blojsom 2.07

setMetaData

public void setMetaData(java.util.Map metaData)
Set the trackback meta-data

Parameters:
metaData - Map containing meta-data for this comment
Since:
blojsom 2.14

getDateAsFormat

public java.lang.String getDateAsFormat(java.lang.String format)
Return the comment date formatted with a specified date format

Parameters:
format - Date format
Returns:
null if the comment date or format is null, otherwise returns the comment date formatted to the specified format. If the format is invalid, returns commentDate.toString()
Since:
blojsom 2.19

getDateAsFormat

public java.lang.String getDateAsFormat(java.lang.String format,
                                        java.util.Locale locale)
Return the comment date formatted with a specified date format

Parameters:
format - Date format
locale - Locale for date formatting
Returns:
null if the entry date or format is null, otherwise returns the entry date formatted to the specified format. If the format is invalid, returns commentDate.toString()
Since:
blojsom 2.30

getBlogEntry

public BlogEntry getBlogEntry()
Retrieve the BlogEntry associated with this comment

Returns:
BlogEntry
Since:
blojsom 2.23

setBlogEntry

public void setBlogEntry(BlogEntry blogEntry)
Set the BlogEntry associated with this comment

Parameters:
blogEntry - BlogEntry
Since:
blojsom 2.23

load

public abstract void load(BlogUser blogUser)
                   throws BlojsomException
Load the blog comment

Parameters:
blogUser - BlogUser
Throws:
BlojsomException
Since:
blojsom 2.26

save

public abstract void save(BlogUser blogUser)
                   throws BlojsomException
Save the blog comment

Parameters:
blogUser - BlogUser
Throws:
BlojsomException
Since:
blojsom 2.26

delete

public abstract void delete(BlogUser blogUser)
                     throws BlojsomException
Delete the blog comment

Parameters:
blogUser - BlogUser
Throws:
BlojsomException
Since:
blojsom 2.26