Classes that implement the EL expression language expose their
functionality via this abstract class. There is no concrete implementation
of this API available in this package. Technologies such as
JavaServer Pages and JavaServer Faces provide access to an
implementation via factory methods.
Unlike previous incarnations of this API, there is no way to parse
and evaluate an expression in one single step. The expression needs to first
be parsed, and then evaluated.
Resolution of model objects is performed at evaluation time, via the
ELResolver associated with the ELContext passed to
the ValueExpression or MethodExpression.
The ELContext object also provides access to the FunctionMapper
and VariableMapper to be used when parsing the expression.
EL function and variable mapping is performed at parse-time, and
the results are
bound to the expression. Therefore, the ELContext ,
FunctionMapper ,
and VariableMapper
are not stored for future use and do not have to be
Serializable.
The createValueExpression and
createMethodExpression methods must be thread-safe. That is,
multiple threads may call these methods on the same
ExpressionFactory object simultaneously. Implementations
should synchronize access if they depend on transient state.
Implementations should not, however, assume that only one object of
each ExpressionFactory type will be instantiated; global
caching should therefore be static.
The ExpressionFactory must be able to handle the following
types of input for the expression parameter:
Single expressions using the ${} delimiter
(e.g. "${employee.lastName}").
Single expressions using the #{} delimiter
(e.g. "#{employee.lastName}").
Literal text containing no ${} or #{}
delimiters (e.g. "John Doe").
Multiple expressions using the same delimiter (e.g.
"${employee.firstName}${employee.lastName}" or
"#{employee.firstName}#{employee.lastName}").
Mixed literal text and expressions using the same delimiter (e.g.
"Name: ${employee.firstName} ${employee.lastName}").
The following types of input are illegal and must cause an
ELException to be thrown:
Multiple expressions using different delimiters (e.g.
"${employee.firstName}#{employee.lastName}").
Mixed literal text and expressions using different delimiters(e.g.
"Name: ${employee.firstName} #{employee.lastName}").
Stringinto a ValueExpression or MethodExpression instance for later evaluation.Classes that implement the EL expression language expose their functionality via this abstract class. There is no concrete implementation of this API available in this package. Technologies such as JavaServer Pages and JavaServer Faces provide access to an implementation via factory methods.
The createValueExpression(ELContext, String, Class>) method is used to parse expressions that evaluate to values (both l-values and r-values are supported). The createMethodExpression(ELContext, String, Class>, Class>[]) method is used to parse expressions that evaluate to a reference to a method on an object.
Unlike previous incarnations of this API, there is no way to parse and evaluate an expression in one single step. The expression needs to first be parsed, and then evaluated.
Resolution of model objects is performed at evaluation time, via the ELResolver associated with the ELContext passed to the
ValueExpressionorMethodExpression.The ELContext object also provides access to the FunctionMapper and VariableMapper to be used when parsing the expression. EL function and variable mapping is performed at parse-time, and the results are bound to the expression. Therefore, the ELContext , FunctionMapper , and VariableMapper are not stored for future use and do not have to be
Serializable.The
createValueExpressionandcreateMethodExpressionmethods must be thread-safe. That is, multiple threads may call these methods on the sameExpressionFactoryobject simultaneously. Implementations should synchronize access if they depend on transient state. Implementations should not, however, assume that only one object of eachExpressionFactorytype will be instantiated; global caching should therefore be static.The
ExpressionFactorymust be able to handle the following types of input for theexpressionparameter:${}delimiter (e.g."${employee.lastName}").#{}delimiter (e.g."#{employee.lastName}").${}or#{}delimiters (e.g."John Doe")."${employee.firstName}${employee.lastName}"or"#{employee.firstName}#{employee.lastName}")."Name: ${employee.firstName} ${employee.lastName}").The following types of input are illegal and must cause an ELException to be thrown:
"${employee.firstName}#{employee.lastName}")."Name: ${employee.firstName} #{employee.lastName}").