class DefaultExpression extends ComplexExpression {
    
    private static final Logger logger = LoggerFactory.getLogger(DefaultExpression.class);


    private static final long serialVersionUID = 1830867943963082362L;


    private static final String OPERATOR = "?:";
    // Future proof, just in case in the future we add other tokens as operators
    static final String[] OPERATORS = new String[] {String.valueOf(OPERATOR)};

    
    private final Expression queriedExpression;
    private final Expression defaultExpression;

    
    public DefaultExpression(final Expression queriedExpression, final Expression defaultExpression) {
        super();
        Validate.notNull(queriedExpression, "Queried expression cannot be null");
        Validate.notNull(defaultExpression, "Default expression cannot be null");
        this.queriedExpression = queriedExpression;
        this.defaultExpression = defaultExpression;
    }
    
    public Expression getQueriedExpression() {
        return this.queriedExpression;
    }

    public Expression getDefaultExpression() {
        return this.defaultExpression;
    }

    
    @Override
    public String getStringRepresentation() {
        final StringBuilder sb = new StringBuilder();
        if (this.queriedExpression instanceof ComplexExpression) {
            sb.append(Expression.NESTING_START_CHAR);
            sb.append(this.queriedExpression);
            sb.append(Expression.NESTING_END_CHAR);
        } else {
            sb.append(this.queriedExpression);
        }
        sb.append(' ');
        sb.append(OPERATOR);
        sb.append(' ');
        if (this.defaultExpression instanceof ComplexExpression) {
            sb.append(Expression.NESTING_START_CHAR);
            sb.append(this.defaultExpression);
            sb.append(Expression.NESTING_END_CHAR);
        } else {
            sb.append(this.defaultExpression);
        }
        return sb.toString();
    }
    
    
    
    
    static ExpressionParsingState composeDefaultExpression(
            final ExpressionParsingState state, final int nodeIndex) {<FILL_FUNCTION_BODY>}
    

    
    
    static Object executeDefault(
            final IExpressionContext context,
            final DefaultExpression expression, final StandardExpressionExecutionContext expContext) {

        if (logger.isTraceEnabled()) {
            logger.trace("[THYMELEAF][{}] Evaluating default expression: \"{}\"", TemplateEngine.threadIndex(), expression.getStringRepresentation());
        }
        
        final Object queriedValue =
                expression.getQueriedExpression().execute(context, expContext);
        
        if (queriedValue == null) {
            return expression.getDefaultExpression().execute(context, expContext);
        }
        return queriedValue;
        
    }

    
}


        // Returning "state" means "try next in chain" or "success"
        // Returning "null" means parsing error

        final String input = state.get(nodeIndex).getInput();

        if (StringUtils.isEmptyOrWhitespace(input)) {
            return null;
        }

        // Trying to fail quickly...
        final int defaultOperatorPos = input.indexOf(OPERATOR);
        if (defaultOperatorPos == -1) {
            return state;
        }
        
        final String queriedStr = input.substring(0, defaultOperatorPos);
        final String defaultStr = input.substring(defaultOperatorPos + 2);
        
        if (defaultStr.contains(OPERATOR)) {
            // There are two "?:" operators
            return null;
        }


        final Expression queriedExpr = ExpressionParsingUtil.parseAndCompose(state, queriedStr);
        if (queriedExpr == null) {
            return null;
        }

        final Expression defaultExpr = ExpressionParsingUtil.parseAndCompose(state, defaultStr);
        if (defaultExpr == null) {
            return null;
        }


        final DefaultExpression defaultExpressionResult = new DefaultExpression(queriedExpr, defaultExpr);
        state.setNode(nodeIndex, defaultExpressionResult);
        
        return state;
        
    
<methods><variables>private static final long serialVersionUID