01: package com.mockrunner.mock.web;
02:
03: import javax.servlet.jsp.el.ELException;
04: import javax.servlet.jsp.el.Expression;
05: import javax.servlet.jsp.el.ExpressionEvaluator;
06: import javax.servlet.jsp.el.FunctionMapper;
07: import javax.servlet.jsp.el.VariableResolver;
08:
09: /**
10: * Mock implementation of <code>Expression</code>.
11: */
12: public class MockExpression extends Expression {
13: private ExpressionEvaluator evaluator;
14: private String expression;
15: private Class expectedType;
16: private FunctionMapper mapper;
17:
18: public MockExpression(ExpressionEvaluator evaluator,
19: String expression, Class expectedType, FunctionMapper mapper) {
20: this .evaluator = evaluator;
21: this .expression = expression;
22: this .expectedType = expectedType;
23: this .mapper = mapper;
24: }
25:
26: public Object evaluate(VariableResolver resolver)
27: throws ELException {
28: return evaluator.evaluate(expression, expectedType, resolver,
29: mapper);
30: }
31: }
|