org.apache.tapestry.services
Interface ExpressionEvaluator

All Known Implementing Classes:
ExpressionEvaluatorImpl

public interface ExpressionEvaluator

Wrapper around the OGNL library.

Since:
4.0
Author:
Howard M. Lewis Ship

Method Summary
 OgnlContext createContext(Object target)
          Creates a default OGNL context object that can be used against the specified object for expression evaluation.
 boolean isConstant(Object target, String expression)
          Returns true if the expression evaluates to a constant or other literal value.
 boolean isConstant(String expression)
          Returns true if the expression evaluates to a constant or other literal value.
 Object read(Object target, ognl.enhance.ExpressionAccessor expression)
          Reads a property of the target, defined by the (previously compiled) expression.
 Object read(Object target, String expression)
          Reads a property of the target, defined by the expression.
 Object readCompiled(Object target, Object expression)
          Reads a property of the target, defined by the (previously compiled) expression.
 void write(Object target, ognl.enhance.ExpressionAccessor expression, Object value)
          Updates a property of the target, defined by the (previously compiled) expression.
 void write(Object target, String expression, Object value)
          Updates a property of the target, defined by the expression.
 void writeCompiled(Object target, Object expression, Object value)
          Updates a property of the target, defined by the (previously compiled) expression.
 

Method Detail

read

Object read(Object target,
            String expression)
Reads a property of the target, defined by the expression.

Throws:
org.apache.hivemind.ApplicationRuntimeException - if the expression can not be parsed, or if some other error occurs during evaluation of the expression.

readCompiled

Object readCompiled(Object target,
                    Object expression)
Reads a property of the target, defined by the (previously compiled) expression.

Throws:
org.apache.hivemind.ApplicationRuntimeException - if some other error occurs during evaluation of the expression.

read

Object read(Object target,
            ognl.enhance.ExpressionAccessor expression)
Reads a property of the target, defined by the (previously compiled) expression.

Parameters:
target - The object to resolve the expression against.
expression - The compiled expression.
Returns:
The result of reading on the expression.

write

void write(Object target,
           String expression,
           Object value)
Updates a property of the target, defined by the expression.

Throws:
org.apache.hivemind.ApplicationRuntimeException - if the expression can not be parsed, or if some other error occurs during evaluation of the expression.

writeCompiled

void writeCompiled(Object target,
                   Object expression,
                   Object value)
Updates a property of the target, defined by the (previously compiled) expression.

Throws:
org.apache.hivemind.ApplicationRuntimeException - if some other error occurs during evaluation of the expression.

write

void write(Object target,
           ognl.enhance.ExpressionAccessor expression,
           Object value)
Updates a property of the target, defined by the (previously compiled) expression.

Parameters:
target - The target object to set a value on.
expression - The pre-compiled expression.
value - The value to set.

isConstant

boolean isConstant(String expression)
Returns true if the expression evaluates to a constant or other literal value.

Throws:
org.apache.hivemind.ApplicationRuntimeException - if the expression is not valid

isConstant

boolean isConstant(Object target,
                   String expression)
Returns true if the expression evaluates to a constant or other literal value.

Throws:
org.apache.hivemind.ApplicationRuntimeException - if the expression is not valid

createContext

OgnlContext createContext(Object target)
Creates a default OGNL context object that can be used against the specified object for expression evaluation.

Parameters:
target - The object to get a context for.
Returns:
An ognl context map.


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.