// Path: src/org/tiefaces/exception/EvaluationException.java
// public class EvaluationException extends RuntimeException {
// 
// 	/** The Constant serialVersionUID. */
// 	private static final long serialVersionUID = 1L;
// 
// 	/**
// 	 * Instantiates a new evaluation exception.
// 	 */
// 	public EvaluationException() {
// 		super();
// 	}
// 
// 	/**
// 	 * Instantiates a new evaluation exception.
// 	 *
// 	 * @param message
// 	 *            the message
// 	 * @param cause
// 	 *            the cause
// 	 * @param enableSuppression
// 	 *            the enable suppression
// 	 * @param writableStackTrace
// 	 *            the writable stack trace
// 	 */
// 	public EvaluationException(final String message, final Throwable cause,
// 			final boolean enableSuppression,
// 			final boolean writableStackTrace) {
// 		super(message, cause, enableSuppression, writableStackTrace);
// 	}
// 
// 	/**
// 	 * Instantiates a new evaluation exception.
// 	 *
// 	 * @param message
// 	 *            the message
// 	 * @param cause
// 	 *            the cause
// 	 */
// 	public EvaluationException(final String message,
// 			final Throwable cause) {
// 		super(message, cause);
// 	}
// 
// 	/**
// 	 * Instantiates a new evaluation exception.
// 	 *
// 	 * @param message
// 	 *            the message
// 	 */
// 	public EvaluationException(final String message) {
// 		super("Evaluation exception = " + message);
// 	}
// 
// 	/**
// 	 * Instantiates a new evaluation exception.
// 	 *
// 	 * @param cause
// 	 *            the cause
// 	 */
// 	public EvaluationException(final Throwable cause) {
// 		super("Evaluation exception = " + cause.getLocalizedMessage(),
// 				cause);
// 	}
// 
// }


import java.util.HashMap;
import java.util.Map;
import org.apache.commons.jexl2.Expression;
import org.apache.commons.jexl2.JexlContext;
import org.apache.commons.jexl2.JexlEngine;
import org.apache.commons.jexl2.MapContext;
import org.tiefaces.exception.EvaluationException;

	 */
	public final Object evaluate(final String expression,
			final Map<String, Object> context) {
		JexlContext jexlContext = new MapContext(context);
		try {
			JexlEngine jexl = JEXL_LOCAL.get();
			Map<String, Expression> expMap = JEXL_MAP_LOCAL.get();
			Expression jexlExpression = expMap.get(expression);
			if (jexlExpression == null) {
				jexlExpression = jexl.createExpression(expression);
				expMap.put(expression, jexlExpression);
			}
			return jexlExpression.evaluate(jexlContext);
		} catch (Exception e) {
			throw new EvaluationException(e);
		}
	}

	/**
	 * evaluate from giving context.
	 * 
	 * @param context
	 *            context.
	 * @return object evaluated.
	 */
	public final Object evaluate(final Map<String, Object> context) {
		JexlContext jexlContext = new MapContext(context);
		try {
			return jExpression.evaluate(jexlContext);
		} catch (Exception e) {

// Path: src/org/tiefaces/exception/EvaluationException.java
// public class EvaluationException extends RuntimeException {
// 
// 	/** The Constant serialVersionUID. */
// 	private static final long serialVersionUID = 1L;
// 
// 	/**
// 	 * Instantiates a new evaluation exception.
// 	 */
// 	public EvaluationException() {
// 		super();
// 	}
// 
// 	/**
// 	 * Instantiates a new evaluation exception.
// 	 *
// 	 * @param message
// 	 *            the message
// 	 * @param cause
// 	 *            the cause
// 	 * @param enableSuppression
// 	 *            the enable suppression
// 	 * @param writableStackTrace
// 	 *            the writable stack trace
// 	 */
// 	public EvaluationException(final String message, final Throwable cause,
// 			final boolean enableSuppression,
// 			final boolean writableStackTrace) {
// 		super(message, cause, enableSuppression, writableStackTrace);
// 	}
// 
// 	/**
// 	 * Instantiates a new evaluation exception.
// 	 *
// 	 * @param message
// 	 *            the message
// 	 * @param cause
// 	 *            the cause
// 	 */
// 	public EvaluationException(final String message,
// 			final Throwable cause) {
// 		super(message, cause);
// 	}
// 
// 	/**
// 	 * Instantiates a new evaluation exception.
// 	 *
// 	 * @param message
// 	 *            the message
// 	 */
// 	public EvaluationException(final String message) {
// 		super("Evaluation exception = " + message);
// 	}
// 
// 	/**
// 	 * Instantiates a new evaluation exception.
// 	 *
// 	 * @param cause
// 	 *            the cause
// 	 */
// 	public EvaluationException(final Throwable cause) {
// 		super("Evaluation exception = " + cause.getLocalizedMessage(),
// 				cause);
// 	}
// 
// }


// Path: src/org/tiefaces/components/websheet/configuration/ExpressionEngine.java
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.jexl2.Expression;
import org.apache.commons.jexl2.JexlContext;
import org.apache.commons.jexl2.JexlEngine;
import org.apache.commons.jexl2.MapContext;
import org.tiefaces.exception.EvaluationException;

	 */
	public final Object evaluate(final String expression,
			final Map<String, Object> context) {
		JexlContext jexlContext = new MapContext(context);
		try {
			JexlEngine jexl = JEXL_LOCAL.get();
			Map<String, Expression> expMap = JEXL_MAP_LOCAL.get();
			Expression jexlExpression = expMap.get(expression);
			if (jexlExpression == null) {
				jexlExpression = jexl.createExpression(expression);
				expMap.put(expression, jexlExpression);
			}
			return jexlExpression.evaluate(jexlContext);
		} catch (Exception e) {
			throw new EvaluationException(e);
		}
	}

	/**
	 * evaluate from giving context.
	 * 
	 * @param context
	 *            context.
	 * @return object evaluated.
	 */
	public final Object evaluate(final Map<String, Object> context) {
		JexlContext jexlContext = new MapContext(context);
		try {
			return jExpression.evaluate(jexlContext);
		} catch (Exception e) {

			throw new EvaluationException(
