public abstract class IDag
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
IDag.EventNotifierAccessor |
Modifier and Type | Field and Description |
---|---|
protected IDag.EventNotifierAccessor |
accessor |
protected java.util.HashMap<TreeReference,QuickTriggerable> |
conditionRepeatTargetIndex |
protected java.util.ArrayList<QuickTriggerable> |
triggerablesDAG |
protected java.util.HashMap<TreeReference,java.util.ArrayList<QuickTriggerable>> |
triggerIndex |
protected java.util.ArrayList<QuickTriggerable> |
unorderedTriggerables |
Modifier | Constructor and Description |
---|---|
protected |
IDag(IDag.EventNotifierAccessor accessor) |
Modifier and Type | Method and Description |
---|---|
Triggerable |
addTriggerable(Triggerable t)
Add the triggerables to the dataset prior to finalizing.
|
abstract void |
copyItemsetAnswer(FormInstance mainInstance,
EvaluationContext evalContext,
TreeReference ref,
TreeElement copyToElement,
boolean midSurvey)
Take actions related to changes of select-one and select-multiple
itemsets.
|
abstract void |
createRepeatGroup(FormInstance mainInstance,
EvaluationContext evalContext,
TreeReference ref,
TreeElement parentElement,
TreeElement createdElement)
Take whatever action is required when creating a repeat group.
|
abstract void |
deleteRepeatGroup(FormInstance mainInstance,
EvaluationContext evalContext,
TreeReference ref,
TreeElement parentElement,
TreeElement deletedElement)
Take whatever action is required when deleting a repeat group.
|
abstract void |
finalizeTriggerables(FormInstance mainInstance,
EvaluationContext evalContext)
Initialize the triggerableDAG array and the triggerIndex array.
|
private QuickTriggerable |
findTriggerable(Triggerable t)
Add the triggerables to the dataset prior to finalizing.
|
IConditionExpr |
getConditionExpressionForTrueAction(FormInstance mainInstance,
TreeElement instanceNode,
int action)
Pull this in from FormOverview so that we can make fields private.
|
java.util.ArrayList<Condition> |
getConditions()
API for retrieving the list of conditions, for use when
serializing the form definition (e.g., into .cache file).
|
abstract FormDef.EvalBehavior |
getEvalBehavior()
The EvalBehavior that the implementation provides.
|
java.util.ArrayList<Recalculate> |
getRecalculates()
API for retrieving thelist of recalculates, for use when
serializing the form definition (e.g., into .cache file).
|
abstract QuickTriggerable |
getTriggerableForRepeatGroup(TreeReference ref)
Used to obtain the triggerable that impacts the relevancy of the repeat
group.
|
abstract java.util.Collection<QuickTriggerable> |
initializeTriggerables(FormInstance mainInstance,
EvaluationContext evalContext,
TreeReference rootRef,
boolean midSurvey)
Invoked externally when a new mainInstance is loaded (initial sweep of
calculates).
|
void |
printTriggerables(java.lang.String path)
For debugging
|
protected void |
publishSummary(java.lang.String lead,
java.util.Collection<QuickTriggerable> quickTriggerables) |
protected void |
publishSummary(java.lang.String lead,
TreeReference ref,
java.util.Collection<QuickTriggerable> quickTriggerables) |
void |
reportDependencyCycles(XFormParserReporter reporter) |
abstract boolean |
shouldTrustPreviouslyCommittedAnswer()
Specifies if unchanged answers should be trusted (and not re-committed).
|
abstract java.util.Collection<QuickTriggerable> |
triggerTriggerables(FormInstance mainInstance,
EvaluationContext evalContext,
TreeReference ref,
boolean midSurvey)
Fire a triggereable.
|
ValidateOutcome |
validate(FormEntryController formEntryControllerToBeValidated,
boolean markCompleted)
Invoked to validate a filled-in form.
|
protected final IDag.EventNotifierAccessor accessor
protected final java.util.ArrayList<QuickTriggerable> triggerablesDAG
protected final java.util.HashMap<TreeReference,QuickTriggerable> conditionRepeatTargetIndex
protected final java.util.HashMap<TreeReference,java.util.ArrayList<QuickTriggerable>> triggerIndex
protected final java.util.ArrayList<QuickTriggerable> unorderedTriggerables
protected IDag(IDag.EventNotifierAccessor accessor)
public abstract FormDef.EvalBehavior getEvalBehavior()
public abstract QuickTriggerable getTriggerableForRepeatGroup(TreeReference ref)
ref
- public abstract java.util.Collection<QuickTriggerable> triggerTriggerables(FormInstance mainInstance, EvaluationContext evalContext, TreeReference ref, boolean midSurvey)
mainInstance
- evalContext
- ref
- midSurvey
- public abstract void deleteRepeatGroup(FormInstance mainInstance, EvaluationContext evalContext, TreeReference ref, TreeElement parentElement, TreeElement deletedElement)
mainInstance
- evalContext
- ref
- parentElement
- deletedElement
- public abstract void createRepeatGroup(FormInstance mainInstance, EvaluationContext evalContext, TreeReference ref, TreeElement parentElement, TreeElement createdElement)
mainInstance
- evalContext
- ref
- parentElement
- createdElement
- public abstract void copyItemsetAnswer(FormInstance mainInstance, EvaluationContext evalContext, TreeReference ref, TreeElement copyToElement, boolean midSurvey)
mainInstance
- evalContext
- ref
- copyToElement
- midSurvey
- private final QuickTriggerable findTriggerable(Triggerable t)
t
- triggerable to addpublic final Triggerable addTriggerable(Triggerable t)
t
- public abstract void finalizeTriggerables(FormInstance mainInstance, EvaluationContext evalContext) throws java.lang.IllegalStateException
mainInstance
- evalContext
- java.lang.IllegalStateException
public abstract java.util.Collection<QuickTriggerable> initializeTriggerables(FormInstance mainInstance, EvaluationContext evalContext, TreeReference rootRef, boolean midSurvey)
mainInstance
- evalContext
- rootRef
- midSurvey
- true if we are during the survey, false if we are on loading/saving phasepublic ValidateOutcome validate(FormEntryController formEntryControllerToBeValidated, boolean markCompleted)
formEntryControllerToBeValidated
- markCompleted
- public abstract boolean shouldTrustPreviouslyCommittedAnswer()
protected void publishSummary(java.lang.String lead, java.util.Collection<QuickTriggerable> quickTriggerables)
protected final void publishSummary(java.lang.String lead, TreeReference ref, java.util.Collection<QuickTriggerable> quickTriggerables)
public final void printTriggerables(java.lang.String path)
public final IConditionExpr getConditionExpressionForTrueAction(FormInstance mainInstance, TreeElement instanceNode, int action)
instanceNode
- action
- public final java.util.ArrayList<Condition> getConditions()
public final java.util.ArrayList<Recalculate> getRecalculates()
public final void reportDependencyCycles(XFormParserReporter reporter)