The abstract base class for an expression-language evaluator. Classes that implement an expression language expose their functionality via this abstract class.
An instance of the ExpressionEvaluator can be obtained via the JspContext / PageContext
The parseExpression() and evaluate() methods must be thread-safe. That is, multiple threads may call these methods on the same ExpressionEvaluator object simultaneously. Implementations should synchronize access if they depend on transient state. Implementations should not, however, assume that only one object of each ExpressionEvaluator type will be instantiated; global caching should therefore be static.
Only a single EL expression, starting with '${' and ending with '}', can be parsed or evaluated at a time. EL expressions cannot be mixed with static text. For example, attempting to parse or evaluate "abc${1+1}def${1+1}ghi
" or even "${1+1}${1+1}
" will cause an ELException
to be thrown.
The following are examples of syntactically legal EL expressions:
${person.lastName}
${8 * 8}
${my:reverse('hello')}
The interface for an expression-language validator and evaluator. Classes that implement an expression language expose their functionality via this interface.
The validate() and evaluate() methods must be thread-safe. That is, multiple threads may call these methods on the same ExpressionEvaluator object simultaneously. Implementations should synchronize access if they depend on transient state. Implementations should not, however, assume that only one object of each ExpressionEvaluator type will be instantiated; global caching should therefore be static. No release() mechanism or robust lifecycle is specified, for language-interpreter pluggability is experimental in EA2.
WARNING: This class supports experimentation for the EA2 release of JSTL; it is not expected to be part of the final RI or specification.
@author Shawn Bayern (based exactly on rev1 draft)ExpressionEvaluator
is used to implement a query expression evaluation of a ResourcePropertySet
. An evaluator can be registered with a QueryEngine
, which in turn calls the evaluator when a matching expression is found.
@see ResourcePropertySet
@see QueryEngine
On my system (Intel P4, 2 GHz, MS Windows XP, JDK 1.4.1), expression "x + 1" evaluates as follows:
Server JVM | Client JVM | |
---|---|---|
Normal EE | 23.7 ns | 64.0 ns |
Fast EE | 31.2 ns | 42.2 ns |
interfaceToImplement
must either be declared public
, or with package scope in the root package (i.e. "no" package). On my system (Intel P4, 2 GHz, MS Windows XP, JDK 1.4.1), expression "x + 1" evaluates as follows:
Server JVM | Client JVM | |
---|---|---|
Normal EE | 23.7 ns | 64.0 ns |
Fast EE | 31.2 ns | 42.2 ns |
ExpressionEvaluator
extracts a property from the message in a generic way. i.e. composite properties can be pulled and aggregated depending on this strategy. This can be used to extract Correlation Ids, Message Ids etc. These objects are used to execute property expressions (usually on the current message) at runtime to extracta dynamic value.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|