org.apache.tapestry.util.prop
Class OgnlUtils

java.lang.Object
  extended by org.apache.tapestry.util.prop.OgnlUtils

public class OgnlUtils
extends Object

Utilities wrappers around OGNL.

Since:
2.2
Version:
$Id: OgnlUtils.java 243791 2004-02-19 17:38:13Z hlship $
Author:
Howard Lewis Ship

Method Summary
static Object get(Object expression, ognl.ClassResolver resolver, Object object)
          Returns the value of the expression evaluated against the object.
static Object get(String expression, ognl.ClassResolver resolver, Object object)
          Returns the value of the expression evaluated against the object.
static Object getParsedExpression(String expression)
          Gets a parsed OGNL expression from the input string.
static void set(Object expression, ognl.ClassResolver resolver, Object target, Object value)
          Updates the target object with the provided value.
static void set(String expression, ognl.ClassResolver resolver, Object target, Object value)
          Parses and caches the expression and uses it to update the target object with the provided value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getParsedExpression

public static Object getParsedExpression(String expression)
Gets a parsed OGNL expression from the input string.

Throws:
ApplicationRuntimeException - if the expression can not be parsed.

set

public static void set(String expression,
                       ognl.ClassResolver resolver,
                       Object target,
                       Object value)
Parses and caches the expression and uses it to update the target object with the provided value.

Throws:
ApplicationRuntimeException - if the expression can not be parsed, or the target can not be updated.

set

public static void set(Object expression,
                       ognl.ClassResolver resolver,
                       Object target,
                       Object value)
Updates the target object with the provided value.

Parameters:
expression - a parsed OGNL expression
Throws:
ApplicationRuntimeException - if the target can not be updated.

get

public static Object get(Object expression,
                         ognl.ClassResolver resolver,
                         Object object)
Returns the value of the expression evaluated against the object.

Parameters:
expression - a parsed OGNL expression
object - the root object
Throws:
ApplicationRuntimeException - if the value can not be obtained from the object.

get

public static Object get(String expression,
                         ognl.ClassResolver resolver,
                         Object object)
Returns the value of the expression evaluated against the object.

Throws:
ApplicationRuntimeException - if the expression can not be parsed, or the value not obtained from the object.