net.sf.jexpel
Interface Expression

All Known Implementing Classes:
AddExpression, AndExpression, ArrayAccess, BinaryExpression, BitwiseAndExpression, BitwiseLeftShiftExpression, BitwiseNotExpression, BitwiseOrExpression, BitwiseRightShiftExpression, BitwiseUnsignedRightShift, BitwiseXorExpression, CallConstructorExpression, CallMethodExpression, ClassAccess, ConditionalExpression, ConstantExpression, DivisionExpression, EqualsExpression, GEExpression, GTExpression, LEExpression, LogicExpression, LTExpression, MultiplicationExpression, NEExpression, NotExpression, OrExpression, PropertyAccess, RemainderExpression, SubtractionExpression, UnaryExpression, UnaryMinus

public interface Expression

An 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.
 

Method Detail

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 executed
value - the new value to set
Throws:
java.lang.Exception - all exceptions. No exceptions are treated for better performance.