Class EvaluationContext
java.lang.Object
org.javarosa.core.model.condition.EvaluationContext
public class EvaluationContext extends Object
A collection of objects that affect the evaluation of an expression, like
function handlers and (not supported) variable bindings.
-
Field Summary
Fields Modifier and Type Field Description IAnswerDatacandidateValuebooleanisCheckAddChildbooleanisConstraint -
Constructor Summary
Constructors Constructor Description EvaluationContext(EvaluationContext base, HashMap<String,DataInstance> formInstances, TreeReference context)EvaluationContext(EvaluationContext base, TreeReference context)EvaluationContext(DataInstance instance)EvaluationContext(DataInstance instance, HashMap<String,DataInstance> formInstances)EvaluationContext(DataInstance instance, HashMap<String,DataInstance> formInstances, EvaluationContext base) -
Method Summary
Modifier and Type Method Description voidaddFallbackFunctionHandler(IFallbackFunctionHandler handler)voidaddFunctionHandler(IFunctionHandler fh)List<TreeReference>expandReference(TreeReference ref)List<TreeReference>expandReference(TreeReference ref, boolean includeTemplates)Searches for all repeated nodes that match the pattern of the 'ref' argument.intgetContextPosition()TreeReferencegetContextRef()IFallbackFunctionHandlergetFallbackFunctionHandler()HashMap<String,IFunctionHandler>getFunctionHandlers()DataInstancegetInstance(String id)DataInstancegetMainInstance()TreeReferencegetOriginalContext()StringgetOutputTextForm()ObjectgetVariable(String name)AbstractTreeElementresolveReference(TreeReference qualifiedRef)voidsetOriginalContext(TreeReference ref)voidsetOutputTextForm(String form)voidsetPredicateProcessSet(int[] loadingDetails)voidsetVariable(String name, Object value)voidsetVariables(HashMap<String,?> variables)
-
Field Details
-
isConstraint
public boolean isConstraint -
candidateValue
-
isCheckAddChild
public boolean isCheckAddChild
-
-
Constructor Details
-
EvaluationContext
-
EvaluationContext
public EvaluationContext(EvaluationContext base, HashMap<String,DataInstance> formInstances, TreeReference context) -
EvaluationContext
public EvaluationContext(DataInstance instance, HashMap<String,DataInstance> formInstances, EvaluationContext base) -
EvaluationContext
-
EvaluationContext
-
-
Method Details
-
getInstance
-
getContextRef
-
setOriginalContext
-
getOriginalContext
-
addFallbackFunctionHandler
-
addFunctionHandler
-
getFallbackFunctionHandler
-
getFunctionHandlers
-
setOutputTextForm
-
getOutputTextForm
-
setVariables
-
setVariable
-
getVariable
-
expandReference
-
expandReference
Searches for all repeated nodes that match the pattern of the 'ref' argument.'/' returns {'/'} can handle sub-repetitions (e.g., {/a[1]/b[1], /a[1]/b[2], /a[2]/b[1]})
- Parameters:
ref- Potentially ambiguous reference- Returns:
- Null if 'ref' is relative reference. Otherwise, returns a vector of references that point to nodes that match 'ref' argument. These references are unambiguous (no index will ever be INDEX_UNBOUND). Template nodes won't be included when matching INDEX_UNBOUND, but will be when INDEX_TEMPLATE is explicitly set.
-
getMainInstance
-
resolveReference
-
getContextPosition
public int getContextPosition() -
setPredicateProcessSet
public void setPredicateProcessSet(int[] loadingDetails)
-