|
|||||||||
| Home >> All >> com >> RuntimeCollective >> questionnaire >> [ bean overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.RuntimeCollective.questionnaire.bean
Class SimpleQuestion

java.lang.Objectcom.RuntimeCollective.questionnaire.bean.SimpleQuestion
- All Implemented Interfaces:
- com.RuntimeCollective.webapps.bean.EntityBean, Question, java.io.Serializable
- Direct Known Subclasses:
- XInManyStringsQuestion
- public abstract class SimpleQuestion
- extends java.lang.Object
- implements Question
- extends java.lang.Object
Basic and incomplete implementation of the Question interface, which you
can subclass at will to create new types of Questions.
In your sub classes, you should define some Fields to store the possible
answers (*not* Answers), and override isAnswerValid and
makeNewAnswer, and (most probably) save,
delete and the 2 usual constructors.
- Version:
- $Id: SimpleQuestion.java,v 1.9 2003/09/30 15:12:53 joe Exp $
| Field Summary | |
static java.lang.String |
DATABASE_TABLE
The name of the database table for this bean type. |
protected java.lang.String |
Description
The Description of this SimpleQuestion |
protected int |
id
This object's id |
protected java.lang.String |
Name
The Name of this SimpleQuestion |
protected int |
QuestionnaireId
The Questionnaire |
| Fields inherited from interface com.RuntimeCollective.webapps.bean.EntityBean |
INTERFACE_BEAN, NULL_ID |
| Constructor Summary | |
SimpleQuestion()
Construct a new blank SimpleQuestion, giving it a new unique ID. |
|
SimpleQuestion(int id)
Get a current SimpleQuestion from the RuntimeDataSource, given an id. |
|
| Method Summary | |
void |
delete()
Delete this bean from the database. |
java.lang.String |
getDescription()
Get the Description of this SimpleQuestion |
int |
getId()
Get the unique id of this bean instance. |
java.lang.String |
getName()
Get the Name of this SimpleQuestion |
Questionnaire |
getQuestionnaire()
Get the Questionnaire of this Question |
abstract boolean |
isAnswerValid(java.lang.Object answer)
Check the validity of a raw Object answer for this Question. |
abstract Answer |
makeNewAnswer(java.lang.Object answer)
Make a new Answer to this Question, based on a row answer Object. |
void |
save()
Save this bean to the database. |
void |
setDescription(java.lang.String description)
Set the Description of this SimpleQuestion |
void |
setId(int id)
Set the unique id of this bean instance. |
void |
setName(java.lang.String name)
Set the Name of this SimpleQuestion |
void |
setQuestionnaire(Questionnaire questionnaire)
Set the Questionnaire of this Question |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 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
id
protected int id
- This object's id
Name
protected java.lang.String Name
- The Name of this SimpleQuestion
Description
protected java.lang.String Description
- The Description of this SimpleQuestion
QuestionnaireId
protected int QuestionnaireId
- The Questionnaire
| Constructor Detail |
SimpleQuestion
public SimpleQuestion()
- Construct a new blank SimpleQuestion, giving it a new unique ID.
SimpleQuestion
public SimpleQuestion(int id)
- Get a current SimpleQuestion from the RuntimeDataSource, given an id.
| Method Detail |
setId
public void setId(int id)
getId
public int getId()
save
public void save()
delete
public void delete()
setName
public void setName(java.lang.String name)
getName
public java.lang.String getName()
setDescription
public void setDescription(java.lang.String description)
- Set the Description of this SimpleQuestion
- Specified by:
setDescriptionin interfaceQuestion
getDescription
public java.lang.String getDescription()
- Get the Description of this SimpleQuestion
- Specified by:
getDescriptionin interfaceQuestion
setQuestionnaire
public void setQuestionnaire(Questionnaire questionnaire)
- Set the Questionnaire of this Question
- Specified by:
setQuestionnairein interfaceQuestion
getQuestionnaire
public Questionnaire getQuestionnaire()
- Get the Questionnaire of this Question
- Specified by:
getQuestionnairein interfaceQuestion
makeNewAnswer
public abstract Answer makeNewAnswer(java.lang.Object answer) throws com.RuntimeCollective.questionnaire.InvalidAnswerException
- Make a new Answer to this Question, based on a row answer Object.
This checks the validity of the raw Object answer.- Specified by:
makeNewAnswerin interfaceQuestion
isAnswerValid
public abstract boolean isAnswerValid(java.lang.Object answer)
- Check the validity of a raw Object answer for this Question.
- Specified by:
isAnswerValidin interfaceQuestion
|
|||||||||
| Home >> All >> com >> RuntimeCollective >> questionnaire >> [ bean overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
com.RuntimeCollective.questionnaire.bean.SimpleQuestion