Expression is an object created by the compiler from a text in a context.
A context is the class where the expression will be executed.
The expression follow the common rules of bean navigation. For more information read the Expression Manual. The syntax is very similar to other
- Author:
- Alan N. Lohse
Method Summary |
java.lang.Object |
get(java.lang.Object scope)
Executes the expression and returns its value |
java.lang.Class<?> |
getType()
Gets the result type of the Expression |
void |
set(java.lang.Object scope,
java.lang.Object value)
Executes the expression on set mode. |
getType
java.lang.Class<?> getType()
- Gets the result type of the
Expression
- Returns:
- the type
get
java.lang.Object get(java.lang.Object scope)
throws java.lang.Exception
- Executes the expression and returns its value
- Parameters:
scope
- the object where the expression will be executed
- Returns:
- the result
- Throws:
java.lang.Exception
- all exceptions. No exceptions are treated for better performance.
set
void set(java.lang.Object scope,
java.lang.Object value)
throws java.lang.Exception
- Executes the expression on set mode. On set mode it won't return value.
Not all expressions can be executed on the set mode, the most of them are read only.
For eg.
- 'x+1' is read only, but 'x' is read and write;
- 'x[1]' is is read and write;
- 'Math.sqrt(x)' is read only.
- Parameters:
scope
- the object where the expression will be executedvalue
- the new value to set
- Throws:
java.lang.Exception
- all exceptions. No exceptions are treated for better performance.