public <T> T evaluateValueExpression(String expression, Class<T> expectedType) {
    """
	<p>
	Evaluate a {@link ValueExpression}.
	</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 classes and methods.
	</p>
	
	@param <T> the type of the evaluated expression
	@param expression the expression to evaluate
	@param expectedType the expected type of the evaluated expression
	@return the result of evaluating the expression
	@throws NullPointerException if expectedType is <code>null</code>
	@throws ELException if there are syntactical errors in the provided expression or 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 the expected type
	@see ExpressionFactory#createValueExpression(ELContext, String, Class)
	@see ValueExpression#getValue(ELContext)
    """
      Object result = expressionFactory.createValueExpression(context, expression, expectedType).getValue(context);
      if (result != null) {
         return expectedType.cast(result);
      }
      else {
         return null;
      }
   }
public <T> T evaluateValueExpression(String expression, Class<T> expectedType)
   {
      Object result = expressionFactory.createValueExpression(context, expression, expectedType).getValue(context);
      if (result != null) {
         return expectedType.cast(result);
      }
      else {
         return null;
      }
   }
public < T > T evaluateValueExpression ( String expression , Class < T > expectedType ) { Object result = expressionFactory . createValueExpression ( context , expression , expectedType ) . getValue ( context ) ; if ( result != null ) { return expectedType . cast ( result ) ; } else { return null ; } }
<p>
Evaluate a {@link ValueExpression}.
</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 classes and methods.
</p>

@param <T> the type of the evaluated expression
@param expression the expression to evaluate
@param expectedType the expected type of the evaluated expression
@return the result of evaluating the expression
@throws NullPointerException if expectedType is <code>null</code>
@throws ELException if there are syntactical errors in the provided expression or 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 the expected type
@see ExpressionFactory#createValueExpression(ELContext, String, Class)
@see ValueExpression#getValue(ELContext)
<p > Evaluate a { @link ValueExpression } . < / 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 classes and methods . < / p >