public Object evaluate( VariableResolver vResolver ) throws ELException { return evaluator.evaluate(this.expression, this.expectedType, vResolver, this.fMapper); } }
/** * * Evaluates the given expression String * * @param pExpressionString The expression to be evaluated. * @param pExpectedType The expected type of the result of the evaluation * @param pResolver A VariableResolver instance that can be used at * runtime to resolve the name of implicit objects into Objects. * @param functions A FunctionMapper to resolve functions found in * the expression. It can be null, in which case no functions * are supported for this invocation. * @return the expression String evaluated to the given expected * type **/ public Object evaluate (String pExpressionString, Class pExpectedType, VariableResolver pResolver, FunctionMapper functions) throws ELException { return evaluate (pExpressionString, pExpectedType, pResolver, functions, sLogger); }
/** * Evaluate an EL expression. <p> * * @param <T> the return type of the expression * @param expr EL expression to evaluate. * @param clazz return type of the EL expression. * @return the object the EL expression evaluated to. * @throws Exception thrown if an EL function failed due to a transient error or EL expression could not be * evaluated. */ @SuppressWarnings({"unchecked", "deprecation"}) public <T> T evaluate(String expr, Class<T> clazz) throws Exception { ELEvaluator existing = current.get(); try { current.set(this); return (T) evaluator.evaluate(expr, clazz, context, context); } catch (ELException ex) { if (ex.getRootCause() instanceof Exception) { throw (Exception) ex.getRootCause(); } else { throw ex; } } finally { current.set(existing); } }
/** * Evaluate an EL expression. <p> * * @param <T> the return type of the expression * @param expr EL expression to evaluate. * @param clazz return type of the EL expression. * @return the object the EL expression evaluated to. * @throws Exception thrown if an EL function failed due to a transient error or EL expression could not be * evaluated. */ @SuppressWarnings({"unchecked", "deprecation"}) public <T> T evaluate(String expr, Class<T> clazz) throws Exception { ELEvaluator existing = current.get(); try { current.set(this); return (T) evaluator.evaluate(expr, clazz, context, context); } catch (ELException ex) { if (ex.getRootCause() instanceof Exception) { throw (Exception) ex.getRootCause(); } else { throw ex; } } finally { current.set(existing); } }
/** * this method is for design time expression evaluation. Currently it only * handles * * @param expression * @param pageVars * @param jspFile * @param options * XXX: not used today. In the future, we may support things like * locale in options * @return */ public Object evaluateExpression(String expression, Class expectedClass, Map options) throws ELException { expression = JSFELParserHelper.toJspElExpression(expression); ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl(); FunctionMapper mapper = new EmptyFunctionMapper(); return evaluator.evaluate(expression, expectedClass, resolver, mapper); }