|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objectplanet.survey.plugin.api.Response
ATTENTION: This class is a
facade for the system business Response. To improve performance you can
force it to keep the reference to the business object by calling keepBusinessObject()
. Keeping references to objects may cause inconsistencies in the system, so
allways remember to call releaseBusinessObject()
as soon as you
are finished using them.
Response
object contains respondent's answers to a question.
Subclasses for the object implement response logic for different types of
questions. This class stores respondents answer to the essay fields and
free text.
Flag isPersisted
is true if the response is already saved in
the storage.
If during validation the response happens to
contain incorrect values, the isValid
flag in the Response
object is set to false and errorMessage
will contain the
message to show to the respondent.
If isValid()
returns false, and getErrorMessage()
returns null, the error is in one or more of the essay fields (or matrix
cells), and you have to search through them to find the invalid ones. Use
isValid(int essayFieldIndex)
and getErrorMessage(int essayFieldIndex)
.
Method Summary | |
void |
deleteEssayResponse(int essayFieldIndex)
Deletes response to the essay field. |
java.lang.String |
getErrorMessage()
Gets the error message for the response. |
java.lang.String |
getErrorMessage(int essayFieldIndex)
Gets the error message for an essay field. |
java.lang.String |
getEssayResponse(int essayFieldIndex,
int essayFieldType)
Gets the response value for the specified essay field |
java.lang.String |
getFreeText()
Gets the answer to the free text. |
long |
getQuestionNo()
Gets the questionId attribute of the Response object |
long |
getRespondentId()
Gets the respondentId of the Response object |
boolean |
hasBusinessObject()
Check if this question has reference to the business Response object. |
boolean |
isPersisted()
Gets the isPersisted attribute of the Response object |
boolean |
isValid()
Checks if response to the question is valid. |
boolean |
isValid(int essayFieldIndex)
Checks if response to the essay field is valid. |
void |
keepBusinessObject()
Get and keep business object. |
void |
releaseBusinessObject()
Release business object. |
void |
setEssayResponse(int essayFieldIndex,
int essayFieldType,
java.lang.String answer)
Sets the answer to an essay field. |
void |
setFreeText(java.lang.String freeText)
Sets the free text answer |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public void setEssayResponse(int essayFieldIndex, int essayFieldType, java.lang.String answer) throws java.lang.IllegalArgumentException, SurveySystemException
essayFieldIndex
- Position of the essaf field. Starts at
0.essayFieldType
- Essay field type. One of the types
defined in Question.answer
- The response to the essay field
java.lang.IllegalArgumentException
- If illegal parameters
SurveySystemException
- If any error occurs in the system.public void setFreeText(java.lang.String freeText) throws SurveySystemException
freeText
- The new free text
SurveySystemException
- If any error occurs in the system.public java.lang.String getErrorMessage() throws SurveySystemException
SurveySystemException
- If any error occurs in the system.public java.lang.String getErrorMessage(int essayFieldIndex) throws SurveySystemException
essayFieldIndex
- Position of the essay field. Starts at 0.
SurveySystemException
- If any error occurs in the system.public java.lang.String getEssayResponse(int essayFieldIndex, int essayFieldType) throws java.lang.IllegalArgumentException, SurveySystemException
essayFieldIndex
- Essay field position. Starts at 0.essayFieldType
- Essay field type. One of the types
defined in Question.
java.lang.IllegalArgumentException
- If illegal positions
SurveySystemException
- If any error occurs in the system.public java.lang.String getFreeText() throws SurveySystemException
SurveySystemException
- If any error occurs in the system.public long getQuestionNo()
public long getRespondentId()
public boolean isPersisted() throws SurveySystemException
SurveySystemException
- If any error occurs in the system.public boolean isValid() throws SurveySystemException
SurveySystemException
- If any error occurs in the system.public boolean isValid(int essayFieldIndex) throws SurveySystemException
essayFieldIndex
- Position of the essay field. Starts at 0.
SurveySystemException
- If any error occurs in the system.public void deleteEssayResponse(int essayFieldIndex) throws SurveySystemException
essayFieldIndex
- Position of the essay field. Starts at 0.
SurveySystemException
- If any error occurs in the system.public boolean hasBusinessObject()
public void keepBusinessObject() throws SurveySystemException
SurveySystemException
- If an error occurs in the system.public void releaseBusinessObject()
|
Copyright © ObjectPlanet Inc. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |