/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.commons.jexl3;

/**
 * Represents a single JEXL expression.
 * <p>
 * This simple interface provides access to the underlying textual expression through
 * {@link JexlExpression#getSourceText()}.
 * </p>
 *
 * <p>
 * An expression is different than a script - it is simply a reference to
 * a single expression, not to multiple statements.
 * This implies 'if','for','while','var' and blocks '{'... '}'are NOT allowed in expressions.
 * </p>
 *
 * @since 1.0
 */
public interface JexlExpression {

    /**
     * Evaluates the expression with the variables contained in the
     * supplied {@link JexlContext}.
     *
     * @param context A JexlContext containing variables.
     * @return The result of this evaluation
     * @throws JexlException on any error
     */
    Object evaluate(JexlContext context);

    /**
     * Returns the source text of this expression.
     * 
     * @return the source text
     */
    String getSourceText();

    /**
     * Recreates the source text of this expression from the internal synactic tree.
     * 
     * @return the source text
     */
    String getParsedText();
}

@@ -832,16 +832,55 @@
 jexl3;%0A%0A
+import java.util.concurrent.Callable;%0A%0A
 /**%0A * R
@@ -1352,17 +1352,16 @@
 ssion %7B%0A
-%0A
     /**%0A
@@ -1725,33 +1725,32 @@
 pression.%0A     *
- 
 %0A     * @return 
@@ -1883,16 +1883,17 @@
 rnal syn
+t
 actic tr
@@ -1902,17 +1902,16 @@
 .%0A     *
- 
 %0A     * 
@@ -1969,11 +1969,416 @@
 dText();
+%0A%0A    /**%0A     * Creates a Callable from this expression.%0A     *%0A     * %3Cp%3EThis allows to submit it to an executor pool and provides support for asynchronous calls.%3C/p%3E%0A     * %3Cp%3EThe interpreter will handle interruption/cancellation gracefully if needed.%3C/p%3E%0A     *%0A     * @param context the context%0A     * @return the callable%0A     * @since 3.1%0A     */%0A    Callable%3CObject%3E callable(JexlContext context);
 %0A%7D%0A

Add callable method to JexlExpression interface - breaks compatibility but it is not expected than any codeimplements this interface besides Jexl