src/main/java/ognl/Ognl.java
public static Object getValue(Object tree, Map context, Object root, Class resultType)
            throws OgnlException
    {
        Object result;
        OgnlContext ognlContext = (OgnlContext) addDefaultContext(root, context);

        Node node = (Node)tree;

        if (node.getAccessor() != null)
            result =  node.getAccessor().get(ognlContext, root);
        else
            result = node.getValue(ognlContext, root);

        if (resultType != null) {
            result = getTypeConverter(context).convertValue(context, root, null, null, result, resultType);
        }
        return result;
    }
public static Object getValue(Object tree, Map context, Object root, Class resultType)
            throws OgnlException
    {
        Object result;
        OgnlContext ognlContext = (OgnlContext) addDefaultContext(root, context);

        Node node = (Node)tree;

        if (node.getAccessor() != null)
            result =  node.getAccessor().get(ognlContext, root);
        else
            result = node.getValue(ognlContext, root);

        if (resultType != null) {
            result = getTypeConverter(context).convertValue(context, root, null, null, result, resultType);
        }
        return result;
    }
Evaluates the given OGNL expression tree to extract a value from the given root object. The
default context is set for the given context and root via <CODE>addDefaultContext()</CODE>.

@param tree
the OGNL expression tree to evaluate, as returned by parseExpression()
@param context
the naming context for the evaluation
@param root
the root object for the OGNL expression
@param resultType
the converted type of the resultant object, using the context's type converter
@return the result of evaluating the expression
@throws MethodFailedException
if the expression called a method which failed
@throws NoSuchPropertyException
if the expression referred to a nonexistent property
@throws InappropriateExpressionException
if the expression can't be used in this context
@throws OgnlException
if there is a pathological environmental problem