Class ForeachDefinition
java.lang.Object
com.aquima.interactions.expressions.tsl.parse.nodes.ForeachDefinition
- All Implemented Interfaces:
IParseNode
Parse node representing a FOREACH loop from a TSL expression.
- Since:
- 6.4
- Author:
- O. Kerpershoek
-
Constructor Summary
ConstructorsConstructorDescriptionForeachDefinition
(int position, String typeName, String fromNode, String whereNode, String orderBy, IParseNode contentNode) Constructs the parse node with the required arguments. -
Method Summary
Modifier and TypeMethodDescriptionThis 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.int
This method returns the position in the original text where the node started.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.
-
Constructor Details
-
ForeachDefinition
public ForeachDefinition(int position, String typeName, String fromNode, String whereNode, String orderBy, IParseNode contentNode) Constructs the parse node with the required arguments.- Parameters:
position
- The position of the loop within the TSL expression.typeName
- The type of the instance that is iterated over.fromNode
- The expression that results in a list of instances.whereNode
- The condition that should be evaluated for each instance.orderBy
- The attribute and direction that should be used to sort the instances.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.
-
getContent
This method returns the contents that should be expanded for each instance.- Returns:
- the contents that should be expanded for each instance.
-
isOrderAscending
public boolean isOrderAscending()This method returns a boolean indicating if the instances should be sorted ascending.- Returns:
- a boolean indicating if the instances should be sorted ascending.
-
getPosition
public int getPosition()Description copied from interface:IParseNode
This method returns the position in the original text where the node started.- Specified by:
getPosition
in interfaceIParseNode
- Returns:
- The character position in the original text where the node started.
-