integration-cdi/src/main/java/org/ocpsoft/rewrite/cdi/expressions/Expressions.java
public <T> T evaluateValueExpression(String expression)
   {
      Object result = evaluateValueExpression(expression, Object.class);
      if (result != null) {
         return Reflections.<T> cast(result);
      }
      else {
         return null;
      }
   }
public <T> T evaluateValueExpression(String expression)
   {
      Object result = evaluateValueExpression(expression, Object.class);
      if (result != null) {
         return Reflections.<T> cast(result);
      }
      else {
         return null;
      }
   }
<p>
Evaluate a {@link ValueExpression} inferring the return type.
</p>
<p/>
<p>
A {@link ValueExpression} is created by calling
{@link ExpressionFactory#createValueExpression(ELContext, String, Class)} and then
{@link ValueExpression#getValue(ELContext)} is called to obtain the value. For more details on the semantics of
EL, refer to the javadoc for these methods.
</p>

@param <T> the type of the evaluated expression
@param expression expression the expression to evaluate
@return the result of evaluating the expression
@throws ELException if there are syntactical errors in the provided expression
@throws ELException if an exception was thrown while performing property or variable resolution. The thrown
exception will be included as the cause property of this exception, if available.
@throws PropertyNotFoundException if one of the property resolutions failed because a specified variable or
property does not exist or is not readable
@throws ClassCastException if the result cannot be cast to <code>T</code>
@see ExpressionFactory#createValueExpression(ELContext, String, Class)
@see ValueExpression#getValue(ELContext)