Class ForeachDefinition

java.lang.Object
com.aquima.interactions.expressions.tsl.parse.nodes.ForeachDefinition
All Implemented Interfaces:
IParseNode

public class ForeachDefinition extends Object implements IParseNode
Parse node representing a FOREACH loop from a TSL expression.
Since:
6.4
Author:
O. Kerpershoek
  • 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

      public String getTypeName()
      This method returns the type of the instance that is iterated over.
      Returns:
      the type of the instance that is iterated over.
    • getFromExpression

      public String 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

      public String getWhereCondition()
      This method returns the condition that should be applied to each instance.
      Returns:
      the condition that should be applied to each instance.
    • getOrderBy

      public String 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

      public IParseNode 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 interface IParseNode
      Returns:
      The character position in the original text where the node started.