protected Object executeBasic()

in core/src/main/java/org/apache/jsieve/commands/Elsif.java [53:76]


    protected Object executeBasic(MailAdapter mail, Arguments arguments,
                                  Block block, SieveContext context) throws SieveException {
        // Check Syntax
        if (!context.getConditionManager().isElsifAllowed())
            throw context.getCoordinate().commandException(
                    "Unexpected Command: \"elsif\".");

        // Check Runnable
        if (!context.getConditionManager().isElsifRunnable())
            return Boolean.FALSE;

        // Run the tests
        Boolean isTestPassed = (Boolean) arguments.getTestList().execute(mail,
                context);

        // If the tests answered TRUE, execute the Block
        if (isTestPassed) execute(mail, block, context);

        // Update the ConditionManager
        context.getConditionManager().setElsifTestResult(isTestPassed);

        // Return the result
        return isTestPassed;
    }