Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.RuntimeCollective.bboard.bean
Class SimpleMessage  view SimpleMessage download SimpleMessage.java

java.lang.Object
  extended bycom.RuntimeCollective.content.bean.SimpleContent
      extended bycom.RuntimeCollective.content.bean.TextComponent
          extended bycom.RuntimeCollective.bboard.bean.SimpleMessage
All Implemented Interfaces:
java.lang.Cloneable, com.RuntimeCollective.content.bean.Content, com.RuntimeCollective.webapps.bean.Duplicable, com.RuntimeCollective.webapps.bean.EntityBean, Message, java.io.Serializable
Direct Known Subclasses:
AttachmentMessage

public class SimpleMessage
extends com.RuntimeCollective.content.bean.TextComponent
implements Message, java.lang.Cloneable

The SimpleMessage class is TextComponent attached to a Topic.

Version:
$Id: SimpleMessage.java,v 1.18 2003/10/06 17:10:04 joe Exp $

Field Summary
static java.lang.String DATABASE_TABLE
          The name of the database table for this bean type.
protected  java.lang.String Flag
          A string identifying the flag to be shown next to this message.
static java.lang.String INTERFACE_BEAN
          The name of the interface that this bean implements, and which may be used to key this bean on the session.
protected  int ResponseId
          The id of the message that this is a response to (or -1 if this is not a response).
protected  int TopicId
          The Topic
 
Fields inherited from class com.RuntimeCollective.content.bean.TextComponent
Format, MAX_DESCRIPTION_LENGTH, Text, Title
 
Fields inherited from class com.RuntimeCollective.content.bean.SimpleContent
Author_id, CreationDate, id, LastModifiedDate, LastModifierUser_id
 
Fields inherited from interface com.RuntimeCollective.webapps.bean.EntityBean
NULL_ID
 
Constructor Summary
SimpleMessage()
          Construct a new blank Message, giving it a new unique ID.
SimpleMessage(int id)
          Get a Message from the RuntimeDataSource, given an id.
 
Method Summary
 java.lang.Object clone()
          This method may be called to create a new copy of the Object.
 java.lang.Object clone(Topic topic)
          Returns null; does not really support cloning.
 void delete()
          Delete this Message from the database.
 java.lang.String getContent()
          Get the content.
 java.lang.String getContent(java.lang.String format)
          Get the content under a given format.
 java.lang.String getFlag()
          Get a string identifying the flag to be shown next to this message.
 Message getResponse()
          Get the message that this is a response to.
 int getResponseId()
          Get the id of the message that this is a response to (or -1 if this is not a response).
 Topic getTopic()
          Get the Topic
 boolean isNew(com.RuntimeCollective.webapps.bean.User user)
          Whether this message is new to this user.
 void save()
          Save this Message to the database.
 void setContent(java.lang.String content)
          Set the content: set the text in fact.
 void setContent(java.lang.String content, java.lang.String format)
          Set the content under a given format.
 void setFlag(java.lang.String flag)
          Set a string identifying the flag to be shown next to this message.
 void setResponse(Message previous)
          Set the message that this is a response to.
 void setResponseId(int responseId)
          Set the id of the message that this is a response to (or -1 if this is not a response).
 void setTopic(Topic topic)
          Set the Topic
 
Methods inherited from class com.RuntimeCollective.content.bean.TextComponent
getDescription, getFormat, getText, getTitle, setDescription, setFormat, setText, setTextAsHtml, setTitle, viewFormat
 
Methods inherited from class com.RuntimeCollective.content.bean.SimpleContent
customiseDuplicate, getAuthor, getCreationDate, getId, getLastModifiedDate, getLastModifierUser, makeDuplicate, makeDuplicate, setAuthor, setCreationDate, setId, setLastModifiedDate, setLastModifierUser
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.RuntimeCollective.content.bean.Content
getAuthor, getCreationDate, getDescription, getLastModifiedDate, getLastModifierUser, getTitle, setAuthor, setCreationDate, setDescription, setLastModifiedDate, setLastModifierUser, setTitle, viewFormat
 
Methods inherited from interface com.RuntimeCollective.webapps.bean.EntityBean
getId, setId
 
Methods inherited from interface com.RuntimeCollective.webapps.bean.Duplicable
customiseDuplicate, makeDuplicate, makeDuplicate
 

Field Detail

DATABASE_TABLE

public static final java.lang.String DATABASE_TABLE
The name of the database table for this bean type.

See Also:
Constant Field Values

INTERFACE_BEAN

public static final java.lang.String INTERFACE_BEAN
The name of the interface that this bean implements, and which may be used to key this bean on the session.

See Also:
Constant Field Values

TopicId

protected int TopicId
The Topic


Flag

protected java.lang.String Flag
A string identifying the flag to be shown next to this message.


ResponseId

protected int ResponseId
The id of the message that this is a response to (or -1 if this is not a response).

Constructor Detail

SimpleMessage

public SimpleMessage()
              throws java.sql.SQLException
Construct a new blank Message, giving it a new unique ID.


SimpleMessage

public SimpleMessage(int id)
              throws java.sql.SQLException
Get a Message from the RuntimeDataSource, given an id.

Method Detail

save

public void save()
          throws java.sql.SQLException
Save this Message to the database.

Specified by:
save in interface com.RuntimeCollective.webapps.bean.EntityBean

delete

public void delete()
            throws java.sql.SQLException
Delete this Message from the database.

Specified by:
delete in interface com.RuntimeCollective.webapps.bean.EntityBean

setTopic

public void setTopic(Topic topic)
Set the Topic

Specified by:
setTopic in interface Message

getTopic

public Topic getTopic()
Get the Topic

Specified by:
getTopic in interface Message

getFlag

public java.lang.String getFlag()
Get a string identifying the flag to be shown next to this message.

Specified by:
getFlag in interface Message

setFlag

public void setFlag(java.lang.String flag)
Set a string identifying the flag to be shown next to this message.

Specified by:
setFlag in interface Message

setResponseId

public void setResponseId(int responseId)
Set the id of the message that this is a response to (or -1 if this is not a response).

Specified by:
setResponseId in interface Message

getResponseId

public int getResponseId()
Get the id of the message that this is a response to (or -1 if this is not a response).

Specified by:
getResponseId in interface Message

getResponse

public Message getResponse()
Get the message that this is a response to.

Specified by:
getResponse in interface Message

setResponse

public void setResponse(Message previous)
Set the message that this is a response to.

Specified by:
setResponse in interface Message

setContent

public void setContent(java.lang.String content)
Set the content: set the text in fact.

Specified by:
setContent in interface Message

setContent

public void setContent(java.lang.String content,
                       java.lang.String format)
Set the content under a given format.

Specified by:
setContent in interface Message

getContent

public java.lang.String getContent()
Get the content.

Specified by:
getContent in interface Message

getContent

public java.lang.String getContent(java.lang.String format)
Get the content under a given format.

Specified by:
getContent in interface Message

isNew

public boolean isNew(com.RuntimeCollective.webapps.bean.User user)
Whether this message is new to this user.

Specified by:
isNew in interface Message

clone

public java.lang.Object clone()
Description copied from class: java.lang.Object
This method may be called to create a new copy of the Object. The typical behavior is as follows:
  • o == o.clone() is false
  • o.getClass() == o.clone().getClass() is true
  • o.equals(o) is true

However, these are not strict requirements, and may be violated if necessary. Of the three requirements, the last is the most commonly violated, particularly if the subclass does not override Object.equals(Object)>Object.equals(Object) 55 .

If the Object you call clone() on does not implement java.lang.Cloneable (which is a placeholder interface), then a CloneNotSupportedException is thrown. Notice that Object does not implement Cloneable; this method exists as a convenience for subclasses that do.

Object's implementation of clone allocates space for the new Object using the correct class, without calling any constructors, and then fills in all of the new field values with the old field values. Thus, it is a shallow copy. However, subclasses are permitted to make a deep copy.

All array types implement Cloneable, and override this method as follows (it should never fail):

 public Object clone()
 {
   try
     {
       super.clone();
     }
   catch (CloneNotSupportedException e)
     {
       throw new InternalError(e.getMessage());
     }
 }
 


clone

public java.lang.Object clone(Topic topic)
Returns null; does not really support cloning. Only says it does so that school.bean.CourseFaqQuestion can be clonable for the school module.