org.jsurveylib.model.script.interpreter
Class ScriptInterpreter
java.lang.Object
org.jsurveylib.model.script.interpreter.ScriptInterpreter
- All Implemented Interfaces:
- AnswerListener, InsertQuestionListener
public class ScriptInterpreter
- extends java.lang.Object
- implements InsertQuestionListener, AnswerListener
FOR INTERNAL USE ONLY.
Copyright (c)2007, Daniel Kaplan
- Since:
- 7.10.4
- Author:
- Daniel Kaplan
Constructor Summary |
ScriptInterpreter(Survey survey,
java.lang.String initScript,
java.lang.String onAnswerChanged)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ScriptInterpreter
public ScriptInterpreter(Survey survey,
java.lang.String initScript,
java.lang.String onAnswerChanged)
updateValue
public void updateValue(Question question)
eval
public java.lang.Object eval(java.lang.String expression)
wrapAndThrowException
protected void wrapAndThrowException(java.lang.Exception e)
answerChanged
public final void answerChanged(Question question,
boolean evaluateScript)
- Description copied from interface:
AnswerListener
- This method will be called when the answer of a question is changed
- Specified by:
answerChanged
in interface AnswerListener
- Parameters:
question
- The question whose answer changedevaluateScript
- If true, the survey's script will be evaluated. If false, the script will not be evaluated.
questionInserted
public void questionInserted(Question question,
int page,
int row)
- Specified by:
questionInserted
in interface InsertQuestionListener
getQuestions
public java.util.Collection<Question> getQuestions()
getOnAnswerChanged
public java.lang.String getOnAnswerChanged()