Class AbstractQuestionExportHandler

java.lang.Object
ch.tocco.nice2.optional.survey.impl.action.export.questionhandlers.AbstractQuestionExportHandler
All Implemented Interfaces:
QuestionExportHandler
Direct Known Subclasses:
AbstractMatrixExportHandler, ChoiceQuestionExportHandler, TextQuestionExportHandler

public abstract class AbstractQuestionExportHandler extends Object implements QuestionExportHandler
handles all columns of SurveyExportActionService other than: - columns 11 - 12 which contain data about the answer possibilities and titles - columns 16 - 17 which contain data about the answers
  • Field Details

  • Constructor Details

    • AbstractQuestionExportHandler

      public AbstractQuestionExportHandler()
  • Method Details

    • getData

      public List<List<Object>> getData(Entity surveyQuestionAnswer)
      Specified by:
      getData in interface QuestionExportHandler
      Parameters:
      surveyQuestionAnswer - the entity to get the values for
      Returns:
      a list of lists with values to display (list of lists because it can be multiple lines)
    • getEntitiesToCreateLinesFor

      protected abstract Iterable<Entity> getEntitiesToCreateLinesFor(SurveyBean surveyBean)
      this returns a iterable over which will be iterated, to create single lines different question types need to iterate over different entities, because different data is needed this returns a iterable, because we mostly want to return EntityList but in some cases need to join to entity lists for different entities
      Parameters:
      surveyBean - the survey bean to get the entities from
      Returns:
      an iterable of Entity
    • getColumnData

      protected abstract List<Object> getColumnData(Entity sourceEntity, SurveyBean surveyBean)
    • getAnswerData

      protected abstract List<Object> getAnswerData(Entity sourceEntity, SurveyBean surveyBean)
    • createImmutableList

      @SafeVarargs protected final <T> List<Object> createImmutableList(T... entries)