Class WoolIfCommand

    • Constructor Detail

      • WoolIfCommand

        public WoolIfCommand()
    • Method Detail

      • getIfClauses

        public List<WoolIfCommand.Clause> getIfClauses()
        Returns the if clauses. They should be processed from first to last. There should be at least one clause. That is the "if" clause. Any subsequent clauses are "elseif" clauses.
        Returns:
        the if clauses
      • setIfClauses

        public void setIfClauses​(List<WoolIfCommand.Clause> ifClauses)
        Sets the if clauses. They should be processed from first to last. There should be at least one clause. That is the "if" clause. Any subsequent clauses are "elseif" clauses.
        Parameters:
        ifClauses - the if clauses
      • addIfClause

        public void addIfClause​(WoolIfCommand.Clause ifClause)
        Adds an if clause. The clauses should be processed from first to last. There should be at least one clause.That is the "if" clause. Any subsequent clauses are "elseif" clauses.
        Parameters:
        ifClause - the if clause
      • getElseClause

        public WoolNodeBody getElseClause()
        Returns the else clause. If there is no else clause, then this method returns null (default).
        Returns:
        the else clause or null
      • setElseClause

        public void setElseClause​(WoolNodeBody elseClause)
        Sets the else clause. If there is no else clause, this can be set to null (default).
        Parameters:
        elseClause - the else clause or null
      • findReplyById

        public WoolReply findReplyById​(int replyId)
        Description copied from class: WoolCommand
        Tries to find a reply with the specified ID within this command. If no such reply is found, this method returns null.
        Specified by:
        findReplyById in class WoolCommand
        Parameters:
        replyId - the reply ID
        Returns:
        the reply or null
      • getReadVariableNames

        public void getReadVariableNames​(Set<String> varNames)
        Description copied from class: WoolCommand
        Retrieves all variable names that are read in this command and adds them to the specified set.
        Specified by:
        getReadVariableNames in class WoolCommand
        Parameters:
        varNames - the set to which the variable names are added
      • getWriteVariableNames

        public void getWriteVariableNames​(Set<String> varNames)
        Description copied from class: WoolCommand
        Retrieves all variable names that are written in this command and adds them to the specified set.
        Specified by:
        getWriteVariableNames in class WoolCommand
        Parameters:
        varNames - the set to which the variable names are added
      • getNodePointers

        public void getNodePointers​(Set<WoolNodePointer> pointers)
        Description copied from class: WoolCommand
        Retrieves all node pointers that occur in this command and adds them to the specified list.
        Specified by:
        getNodePointers in class WoolCommand
        Parameters:
        pointers - the list to which the node pointers are added
      • executeBodyCommand

        public void executeBodyCommand​(Map<String,​Object> variables,
                                       WoolNodeBody processedBody)
                                throws EvaluationException
        Description copied from class: WoolCommand
        This method is called if this command occurs in a statement body. It executes the command with respect to the specified variable map. Any body content that should be sent to the client, is added to "processedBody". This content can be text or client commands, with all variables resolved.
        Specified by:
        executeBodyCommand in class WoolCommand
        Parameters:
        variables - the variable map
        processedBody - the processed body
        Throws:
        EvaluationException - if an expression cannot be evaluated