Package org.zkoss.xel.zel
Class ELFactory
- java.lang.Object
-
- org.zkoss.xel.zel.ELFactory
-
- All Implemented Interfaces:
ExpressionFactory
- Direct Known Subclasses:
BindXelFactory
public class ELFactory extends java.lang.Object implements ExpressionFactory
An XEL ExpressionFactory implementation based on ZEL ExpressionFactory.- Since:
- 6.0.0
- Author:
- henrichen
-
-
Field Summary
Fields Modifier and Type Field Description protected ExpressionFactory
_expf
-
Fields inherited from interface org.zkoss.xel.ExpressionFactory
FEATURE_CLASS, FEATURE_FUNCTION
-
-
Constructor Summary
Constructors Constructor Description ELFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
evaluate(XelContext xelc, java.lang.String expression, java.lang.Class expectedType)
Evaluates an expression.boolean
isSupported(int feature)
Returns whether an feature is supported.protected ELContext
newELContext(XelContext xelc)
protected ExpressionFactory
newExpressionFactory()
Returns the EL expression factory.Expression
parseExpression(XelContext xelc, java.lang.String expression, java.lang.Class expectedType)
Prepares (a.k.a., compiles) an expression.
-
-
-
Field Detail
-
_expf
protected final ExpressionFactory _expf
-
-
Method Detail
-
isSupported
public boolean isSupported(int feature)
Description copied from interface:ExpressionFactory
Returns whether an feature is supported.- Specified by:
isSupported
in interfaceExpressionFactory
- Parameters:
feature
- which feature to query. It can be a combination ofExpressionFactory.FEATURE_FUNCTION
andExpressionFactory.FEATURE_CLASS
.
-
parseExpression
public Expression parseExpression(XelContext xelc, java.lang.String expression, java.lang.Class expectedType) throws XelException
Description copied from interface:ExpressionFactory
Prepares (a.k.a., compiles) an expression.- Specified by:
parseExpression
in 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:ExpressionFactory
Evaluates an expression.- Specified by:
evaluate
in 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
-
newELContext
protected ELContext newELContext(XelContext xelc)
-
newExpressionFactory
protected ExpressionFactory newExpressionFactory()
Returns the EL expression factory.Default: Use org.zkoss.zel.impl.ExpressionFactoryImpl.
You might override it to use a different implementation.
-
-