Update of /cvsroot/commonjava/other-projects/marmalade/subprojects/ognl-el/src/main/java/org/marmalade/el/ognl
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7841/subprojects/ognl-el/src/main/java/org/marmalade/el/ognl
Added Files:
OgnlExpressionEvaluator.java
Log Message:
added test for ScopedMap (it works!) and added OGNL implementation of ExpressionEvaluator (not tested yet).
--- NEW FILE: OgnlExpressionEvaluator.java ---
/* Created on Mar 26, 2004 */
package org.marmalade.el.ognl;
import java.util.Map;
import org.marmalade.el.ExpressionEvaluationException;
import org.marmalade.el.ExpressionEvaluator;
import ognl.Ognl;
import ognl.OgnlException;
/**
* @author jdcasey
*/
public class OgnlExpressionEvaluator implements ExpressionEvaluator {
/**
*
*/
public OgnlExpressionEvaluator() {
}
/** Evaluate the expression as an OGNL expression, using the specified map for context.
* @see org.marmalade.el.ExpressionEvaluator#evaluate(java.lang.String, java.util.Map)
*/
public Object evaluate(String expression, Map context) throws ExpressionEvaluationException {
try {
return Ognl.getValue(expression, context, (Object)null);
}
catch (OgnlException e) {
throw new ExpressionEvaluationException(expression, e);
}
}
}
|