|
||||||||
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
public class 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 always 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 in-text elements 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 in-text element (or matrix cells), and you have to search through
them to find the invalid ones. Use isValid(int intextIndex)
and
getErrorMessage(int intextIndex)
.
Method Summary | |
---|---|
void |
deleteEssayResponse(int inTextFieldIndex)
Deprecated. use deleteIntextResponse(int intextIndex) |
void |
deleteIntextResponse(int intextIndex)
Deletes response to the in-text element. |
java.lang.String |
getErrorMessage()
Gets the error message for the response. |
java.lang.String |
getErrorMessage(int intextIndex)
Gets the error message for an in-text element. |
java.lang.String |
getEssayResponse(int inTextFieldIndex,
int inTextFieldType)
Deprecated. use getIntextResponse(int intextIndex, int intextType) |
java.lang.String |
getFreeText()
Gets the answer to the free text. |
java.lang.String |
getIntextResponse(int intextIndex,
int intextType)
Gets the response value for the specified in-text element |
long |
getQuestionNo()
Gets the questionId attribute of the Response object |
long |
getRespondentId()
Gets the respondentId of the Response object |
long |
getResponseDate()
Gets the response date (time stamp) for the response submission. |
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 intextIndex)
Checks if response to the in-text element is valid. |
void |
keepBusinessObject()
Get and keep business object. |
void |
releaseBusinessObject()
Release business object. |
void |
setEssayResponse(int inTextFieldIndex,
int inTextFieldType,
java.lang.String answer)
Deprecated. use setIntextResponse(int intextIndex, int intextType, String answer) |
void |
setFreeText(java.lang.String freeText)
Sets the free text answer |
void |
setIntextResponse(int intextIndex,
int intextType,
java.lang.String answer)
Sets the answer to an in-text element. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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 intextIndex) throws SurveySystemException
intextIndex
- Position of the in-text element. Starts at 0.
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 long getResponseDate() throws SurveySystemException
SurveySystemException
- If any error occurs in the system.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 intextIndex) throws SurveySystemException
intextIndex
- Position of the in-text element. 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()
public void setIntextResponse(int intextIndex, int intextType, java.lang.String answer) throws java.lang.IllegalArgumentException, SurveySystemException
intextIndex
- Position of the in-text element. Starts at 0.intextType
- in-text element type. One of the types defined in Question.answer
- The response to the in-text element
java.lang.IllegalArgumentException
- If illegal parameters
SurveySystemException
- If any error occurs in the system.public java.lang.String getIntextResponse(int intextIndex, int intextType) throws java.lang.IllegalArgumentException, SurveySystemException
intextIndex
- Position of the in-text element. Starts at 0.intextType
- in-text element type. One of the types defined in Question.
java.lang.IllegalArgumentException
- If illegal positions
SurveySystemException
- If any error occurs in the system.public void deleteIntextResponse(int intextIndex) throws SurveySystemException
intextIndex
- Position of the in-text element. Starts at 0.
SurveySystemException
- If any error occurs in the system.public void setEssayResponse(int inTextFieldIndex, int inTextFieldType, java.lang.String answer) throws java.lang.IllegalArgumentException, SurveySystemException
inTextFieldIndex
- Position of the in-text field. Starts at 0.inTextFieldType
- In-text field type. One of the types defined in Question.answer
- The response to the in-text field
java.lang.IllegalArgumentException
- If illegal parameters
SurveySystemException
- If any error occurs in the system.public java.lang.String getEssayResponse(int inTextFieldIndex, int inTextFieldType) throws java.lang.IllegalArgumentException, SurveySystemException
inTextFieldIndex
- In-text field position. Starts at 0.inTextFieldType
- In-text field type. One of the types defined in Question.
java.lang.IllegalArgumentException
- If illegal positions
SurveySystemException
- If any error occurs in the system.public void deleteEssayResponse(int inTextFieldIndex) throws SurveySystemException
inTextFieldIndex
- Position of the in-text field. Starts at 0.
SurveySystemException
- If any error occurs in the system.
|
Copyright ? ObjectPlanet Inc. All Rights Reserved. | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |