Class QuestionPreloader

java.lang.Object
org.javarosa.core.model.utils.QuestionPreloader

public class QuestionPreloader
extends Object
The Question Preloader is responsible for maintaining a set of handlers which are capable of parsing 'preload' elements, and their parameters, and returning IAnswerData objects.
Author:
Clayton Sims
  • Constructor Details

    • QuestionPreloader

      public QuestionPreloader()
      Creates a new Preloader with default handlers
  • Method Details

    • addPreloadHandler

      public void addPreloadHandler​(IPreloadHandler handler)
      Adds a new preload handler to this preloader.
      Parameters:
      handler - an IPreloadHandler that can handle a preload type
    • getQuestionPreload

      public IAnswerData getQuestionPreload​(String preloadType, String preloadParams)
      Returns the IAnswerData preload value for the given preload type and parameters
      Parameters:
      preloadType - The type of the preload to be returned
      preloadParams - Parameters for the preload handler
      Returns:
      An IAnswerData corresponding to a pre-loaded value for the given Arguments. null if no preload could successfully be derived due to either the lack of a handler, or to invalid parameters
    • questionPostProcess

      public boolean questionPostProcess​(TreeElement node, String preloadType, String params)