return ast.getValue(new ExpressionState(context, toTypedValue(rootObject), configuration));
}
@SuppressWarnings("unchecked")
public <T> T getValue(EvaluationContext context, Class<T> expectedResultType) throws EvaluationException {
Object result = ast.getValue(new ExpressionState(context, configuration));
if (result != null && expectedResultType != null) {
Class<?> resultType = result.getClass();
if (!expectedResultType.isAssignableFrom(resultType)) {
// Attempt conversion to the requested type, may throw an exception
result = context.getTypeConverter().convertValue(result, TypeDescriptor.valueOf(expectedResultType));