@Override public String getStringRepresentation() { return getStringRepresentation(OPERATOR); }
static Object executeAnd( final IExpressionContext context, final AndExpression expression, final StandardExpressionExecutionContext expContext) { if (logger.isTraceEnabled()) { logger.trace("[THYMELEAF][{}] Evaluating AND expression: \"{}\"", TemplateEngine.threadIndex(), expression.getStringRepresentation()); } final Object leftValue = expression.getLeft().execute(context, expContext); // Short circuit final boolean leftBooleanValue = EvaluationUtils.evaluateAsBoolean(leftValue); if (!leftBooleanValue) { return Boolean.FALSE; } final Object rightValue = expression.getRight().execute(context, expContext); final boolean rightBooleanValue = EvaluationUtils.evaluateAsBoolean(rightValue); return Boolean.valueOf(rightBooleanValue); }
@Override public String getStringRepresentation() { return getStringRepresentation(OPERATOR); }
static Object executeAnd(final Configuration configuration, final IProcessingContext processingContext, final AndExpression expression, final StandardExpressionExecutionContext expContext) { if (logger.isTraceEnabled()) { logger.trace("[THYMELEAF][{}] Evaluating AND expression: \"{}\"", TemplateEngine.threadIndex(), expression.getStringRepresentation()); } final Object leftValue = expression.getLeft().execute(configuration, processingContext, expContext); // Short circuit final boolean leftBooleanValue = EvaluationUtil.evaluateAsBoolean(leftValue); if (!leftBooleanValue) { return Boolean.FALSE; } final Object rightValue = expression.getRight().execute(configuration, processingContext, expContext); final boolean rightBooleanValue = EvaluationUtil.evaluateAsBoolean(rightValue); return Boolean.valueOf(rightBooleanValue); }