|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jsurveylib.model.question.Question
public abstract class Question
FOR INTERNAL USE ONLY.
A single question on the survey
Constructor Summary | |
---|---|
Question(java.lang.String id)
|
Method Summary | |
---|---|
void |
addAnswerListener(AnswerListener listener)
Add an answer listener. |
void |
addEnableListener(EnableListener listener)
|
void |
addValidationListener(ValidationListener listener)
Adds a validation listener to this question. |
void |
addVisibilityListener(VisibilityListener listener)
Adds a visibility listener to this question. |
void |
fireAnswerChanged()
Fire an State Changed Event for this question. |
void |
fireAnswerChanged(boolean evaluateScript)
Fire an State Changed Event for this question |
abstract java.lang.String |
getAnswer()
The answer of this question. |
java.lang.String |
getCurrentValidationMessage()
This will return the current validation message. |
java.lang.String |
getId()
|
Label |
getLabel()
Returns the Label of this question. |
java.lang.String |
getOnAnswerChanged()
|
boolean |
isAnswerable()
Returns true if the question is visible and editable. |
abstract boolean |
isAnswered()
|
boolean |
isEnabled()
|
boolean |
isMandatory()
|
boolean |
isValid()
|
boolean |
isVisible()
|
Question |
populateTemplate(java.lang.String newId,
java.lang.String newLabel,
boolean mandatory,
java.lang.String answer)
Calling this method makes a duplicate of the current question but it doesn't save any of the original question's state. |
void |
removeAnswerListener(AnswerListener listener)
Remove an answer listener. |
void |
removeEnableListener(EnableListener listener)
|
void |
removeValidationListener(ValidationListener listener)
|
void |
removeVisibilityListener(VisibilityListener listener)
|
abstract void |
setAnswer(java.lang.String answer)
Sets the answer of this question. |
void |
setEnabled(boolean enabled)
|
void |
setLabel(Label label)
Set the Label of this question. |
void |
setLabel(java.lang.String labelText)
Set the Label of this question. |
void |
setMandatory(boolean mandatory)
|
void |
setOnAnswerChanged(java.lang.String onAnswerChanged)
|
void |
setValid(boolean valid,
java.lang.String message)
|
void |
setVisible(boolean visible)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jsurveylib.model.Visitable |
---|
accept |
Constructor Detail |
---|
public Question(java.lang.String id)
Method Detail |
---|
public void addAnswerListener(AnswerListener listener)
listener
- The answer listener that will be notified when a question's answer changespublic void removeAnswerListener(AnswerListener listener)
listener
- The answer listener that will be notified when a question's answer changespublic void addVisibilityListener(VisibilityListener listener)
listener
- The listener to add.public void removeVisibilityListener(VisibilityListener listener)
public void addValidationListener(ValidationListener listener)
listener
- The listener to add.public void removeValidationListener(ValidationListener listener)
public void addEnableListener(EnableListener listener)
public void removeEnableListener(EnableListener listener)
public java.lang.String getCurrentValidationMessage()
public boolean isAnswerable()
public abstract boolean isAnswered()
public Label getLabel()
public void setLabel(Label label)
label
- The Label the question will use.public void setLabel(java.lang.String labelText)
labelText
- The label String the question will use.public java.lang.String getId()
public boolean isMandatory()
public void setMandatory(boolean mandatory)
public abstract java.lang.String getAnswer()
public abstract void setAnswer(java.lang.String answer)
answer
- The answer or "" if there is no answer. This should never return null.public boolean isVisible()
public void setVisible(boolean visible)
public boolean isValid()
public void setValid(boolean valid, java.lang.String message)
public boolean isEnabled()
public void setEnabled(boolean enabled)
public void fireAnswerChanged()
public void fireAnswerChanged(boolean evaluateScript)
evaluateScript
- If true, the script will be evaluated from this change. If false, the script will
not be evaluatedpublic Question populateTemplate(java.lang.String newId, java.lang.String newLabel, boolean mandatory, java.lang.String answer)
populateTemplate
in interface Template
newId
- The new ID of this question.newLabel
- The new label of the question or null if the current label should be used.mandatory
- True if this new question should be mandatory, otherwise the question
is optional.answer
- The question will start with this answer. If set to "" or null, the default is
used.
public java.lang.String getOnAnswerChanged()
public void setOnAnswerChanged(java.lang.String onAnswerChanged)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |