Class AbstractMatrixExportHandler
java.lang.Object
ch.tocco.nice2.optional.survey.impl.action.export.questionhandlers.AbstractQuestionExportHandler
ch.tocco.nice2.optional.survey.impl.action.export.questionhandlers.AbstractMatrixExportHandler
- All Implemented Interfaces:
QuestionExportHandler
- Direct Known Subclasses:
MatrixQuestionExportHandler
,TextChoiceQuestionExportHandler
abstract class that handles matrix specific methods
- get answers sorted by x axis
- get label from x axis
- get values for selected answers
-
Field Summary
Fields inherited from class ch.tocco.nice2.optional.survey.impl.action.export.questionhandlers.AbstractQuestionExportHandler
ANSWER_FIELD, LABEL_FIELD, POINTS_FIELD, REL_SURVEY_ANSWER
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
getLabelFromAxis
(Entity sourceEntity, String axis) get the label from a related axisgetListForChoice
(Entity answer, SurveyBean surveyBean) either returns the values for a selected or unselected answer values for selected answer (1, points) values for unselected answer (0, "")protected EntityList
getSurveyAnswersSortedByMatrixX
(SurveyBean surveyBean) resolve all answers from the question and order them by the x axis sortingMethods inherited from class ch.tocco.nice2.optional.survey.impl.action.export.questionhandlers.AbstractQuestionExportHandler
createImmutableList, getAnswerData, getColumnData, getData, getEntitiesToCreateLinesFor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.optional.survey.impl.action.export.questionhandlers.QuestionExportHandler
getTypes
-
Constructor Details
-
AbstractMatrixExportHandler
public AbstractMatrixExportHandler()
-
-
Method Details
-
getSurveyAnswersSortedByMatrixX
resolve all answers from the question and order them by the x axis sorting- Parameters:
surveyBean
- the bean to get the question from- Returns:
- the ordered entity list
-
getLabelFromAxis
get the label from a related axis- Parameters:
sourceEntity
- entity from which to get the axisaxis
- which axis to get (x or y)- Returns:
- the label or an empty string if no axis is related
-
getListForChoice
either returns the values for a selected or unselected answer values for selected answer (1, points) values for unselected answer (0, "")- Parameters:
answer
- the answer to checksurveyBean
- the bean to get the selected answers from- Returns:
- a list of values to display
-