Package org.zkoss.zkmax.xel.el
Class ApacheELFactory
- java.lang.Object
-
- org.zkoss.zkmax.xel.el.ApacheELFactory
-
- All Implemented Interfaces:
ExpressionFactory
public class ApacheELFactory extends java.lang.Object implements ExpressionFactory
An implementation that is based on Apache commons-el: org.apache.commons.el.ExpressionEvaluatorImpl.Available in ZK EE
The org.zkoss.xel.el.ELFactory class is recommended since the implementation it encapsulates has the better performance.
- Since:
- 3.0.0
- Author:
- tomyeh
-
-
Field Summary
-
Fields inherited from interface org.zkoss.xel.ExpressionFactory
FEATURE_CLASS, FEATURE_FUNCTION
-
-
Constructor Summary
Constructors Constructor Description ApacheELFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectevaluate(XelContext xelc, java.lang.String expression, java.lang.Class expectedType)Evaluates an expression.booleanisSupported(int feature)Returns whether an feature is supported.protected javax.servlet.jsp.el.ExpressionEvaluatornewExpressionEvaluator()Returns the EL expression factory.ExpressionparseExpression(XelContext xelc, java.lang.String expression, java.lang.Class expectedType)Prepares (a.k.a., compiles) an expression.
-
-
-
Method Detail
-
isSupported
public boolean isSupported(int feature)
Description copied from interface:ExpressionFactoryReturns whether an feature is supported.- Specified by:
isSupportedin interfaceExpressionFactory- Parameters:
feature- which feature to query. It can be a combination ofExpressionFactory.FEATURE_FUNCTIONandExpressionFactory.FEATURE_CLASS.
-
parseExpression
public Expression parseExpression(XelContext xelc, java.lang.String expression, java.lang.Class expectedType) throws XelException
Description copied from interface:ExpressionFactoryPrepares (a.k.a., compiles) an expression.- Specified by:
parseExpressionin interfaceExpressionFactory- Parameters:
xelc- the context information to prepare the expression. It can be null, in which case no functions are supported for this invocation.expression- the expression to be evaluated.expectedType- the expected type of the result of the evaluation- Throws:
XelException
-
evaluate
public java.lang.Object evaluate(XelContext xelc, java.lang.String expression, java.lang.Class expectedType) throws XelException
Description copied from interface:ExpressionFactoryEvaluates an expression.- Specified by:
evaluatein interfaceExpressionFactory- Parameters:
xelc- the context information to evaluate an expression. It can be null, in which case no functions are supported for this invocation.expression- the expression to be evaluated. Note: the expression is enclosed with ${ and }, regardless of what implementation is used.expectedType- the expected type of the result of the evaluation- Throws:
XelException
-
newExpressionEvaluator
protected javax.servlet.jsp.el.ExpressionEvaluator newExpressionEvaluator()
Returns the EL expression factory.Default: Use org.apache.commons.el.ExpressionEvaluatorImpl.
You might override it to use a different implementation.
-
-