Class InPlaceForCommand<I extends VariableDeclaration>

  • Type Parameters:
    I - the variable declaration type

    public class InPlaceForCommand<I extends VariableDeclaration>
    extends InPlaceCommand<I>
    Replaces an in-place for-command/expression within a string/content expression.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • InPlaceForCommand

        public InPlaceForCommand​(I iterator,
                                 Expression init,
                                 Expression separator,
                                 Expression endSeparator)
        Creates an in-place loop command.
        Parameters:
        iterator - the iterator variable
        init - the initialization expression (collection over iterator)
        separator - the optional element separator
        endSeparator - the optional end separator
    • Method Detail

      • getIterator

        public I getIterator()
        Returns the iterator variable.
        Returns:
        the iterator variable
      • getInit

        public Expression getInit()
        Returns the initialization expression.
        Returns:
        the initialization expression
      • getSeparator

        public Expression getSeparator()
        Returns the element separator.
        Returns:
        the element separator
      • getEndSeparator

        public Expression getEndSeparator()
        Returns the optional end separator.
        Returns:
        the end separator expression (may be null)
      • getBody

        public java.util.List<Expression> getBody()
        Returns the body expressions.
        Returns:
        the body expressions
      • append

        protected void append​(java.util.List<Expression> exprs)
        Description copied from class: InPlaceCommand
        Appends the sub-expressions in parse sequence to exprs leaving out this command as fallback.
        Specified by:
        append in class InPlaceCommand<I extends VariableDeclaration>
        Parameters:
        exprs - the expressions to add the sub-expressions to