src/main/java/ognl/Ognl.java
public static void setValue(Object tree, Map context, Object root, Object value)
            throws OgnlException
    {
        OgnlContext ognlContext = (OgnlContext) addDefaultContext(root, context);
        Node n = (Node) tree;

        if (n.getAccessor() != null) {
            n.getAccessor().set(ognlContext, root, value);
            return;
        }

        n.setValue(ognlContext, root, value);
    }
public static void setValue(Object tree, Map context, Object root, Object value)
            throws OgnlException
    {
        OgnlContext ognlContext = (OgnlContext) addDefaultContext(root, context);
        Node n = (Node) tree;

        if (n.getAccessor() != null) {
            n.getAccessor().set(ognlContext, root, value);
            return;
        }

        n.setValue(ognlContext, root, value);
    }
public static void setValue ( Object tree , Map context , Object root , Object value ) throws OgnlException { OgnlContext ognlContext = ( OgnlContext ) addDefaultContext ( root , context ) ; Node n = ( Node ) tree ; if ( n . getAccessor ( ) != null ) { n . getAccessor ( ) . set ( ognlContext , root , value ) ; return ; } n . setValue ( ognlContext , root , value ) ; }
Evaluates the given OGNL expression tree to insert a value into the object graph rooted at
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 value
the value to insert into the object graph
@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
Evaluates the given OGNL expression tree to insert a value into the object graph rooted at the given root object . The default context is set for the given context and root via <CODE > addDefaultContext () < / CODE > .