Class ForeachNode
java.lang.Object
com.aquima.interactions.expressions.tsl.evaluator.nodes.ForeachNode
- All Implemented Interfaces:
ITslNode
This node is responsible for iterating over instances and evaluating the contents for each instance.
- Since:
- 5.0
- Author:
- O. Kerpershoek
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
expand
(IValueSource source, OutputBuffer output, ILanguage language) The expand method should evaluate the node for the given language, and append the result to the output buffer supplied.This method returns the contents that should be expanded for each instance.This method returns the expression that should be used to collect the instances.This method returns the name of the attribute that should be used to sort the instances on.This method returns the type of the instance that is iterated over.This method returns the condition that should be applied to each instance.boolean
This method returns a boolean indicating if the instances should be sorted ascending.protected IValue[]
sortValues
(IValue... values) toString()
void
visit
(ITslNodeVisitor visitor) This method allows visitation of the node.
-
Constructor Details
-
ForeachNode
public ForeachNode(String typeName, IExpr fromNode, IExpr whereCondition, String orderBy, boolean ascending, ITslNode contentNode) Constructs the node with the required arguments.- Parameters:
typeName
- The type of the instance that is iterated over.fromNode
- The expression that results in a list of instances.whereCondition
- The condition that should be evaluated for each instance.orderBy
- The attribute and direction that should be used to sort the instances.ascending
- a boolean indicating if the instances should be sorted ascending.contentNode
- The contents that should be expanded for each instance.
-
-
Method Details
-
getTypeName
This method returns the type of the instance that is iterated over.- Returns:
- the type of the instance that is iterated over.
-
getFromExpression
This method returns the expression that should be used to collect the instances.- Returns:
- the expression that should be used to collect the instances.
-
getWhereCondition
This method returns the condition that should be applied to each instance.- Returns:
- the condition that should be applied to each instance.
-
getOrderBy
This method returns the name of the attribute that should be used to sort the instances on.- Returns:
- the name of the attribute that should be used to sort the instances on.
-
isOrderedAscending
public boolean isOrderedAscending()This method returns a boolean indicating if the instances should be sorted ascending.- Returns:
- a boolean indicating if the instances should be sorted ascending.
-
getContent
This method returns the contents that should be expanded for each instance.- Returns:
- the contents that should be expanded for each instance.
-
expand
Description copied from interface:ITslNode
The expand method should evaluate the node for the given language, and append the result to the output buffer supplied. When the node also contains child elements, this expand method should invoke the child elements too. -
sortValues
-
visit
Description copied from interface:ITslNode
This method allows visitation of the node. The visit method will not invoke the visitor for any child nodes. -
toString
-