Package org.zkoss.xel
Interface ExpressionFactory
public interface ExpressionFactory
Used to prepare expressions (
Expression).- Since:
- 3.0.0
- Author:
- tomyeh
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intUsed withisSupported(int)to know whether the factory supportsFunctionMapperExt.resolveClass(java.lang.String)static final intUsed withisSupported(int)to know whether the factory supportsFunctionMapper.resolveFunction(java.lang.String, java.lang.String) -
Method Summary
Modifier and TypeMethodDescriptionevaluate(XelContext ctx, String expression, Class<?> expectedType) Evaluates an expression.booleanisSupported(int feature) Returns whether an feature is supported.parseExpression(XelContext ctx, String expression, Class<?> expectedType) Prepares (a.k.a., compiles) an expression.
-
Field Details
-
FEATURE_FUNCTION
static final int FEATURE_FUNCTIONUsed withisSupported(int)to know whether the factory supportsFunctionMapper.resolveFunction(java.lang.String, java.lang.String)- See Also:
-
FEATURE_CLASS
static final int FEATURE_CLASSUsed withisSupported(int)to know whether the factory supportsFunctionMapperExt.resolveClass(java.lang.String)- See Also:
-
-
Method Details
-
isSupported
boolean isSupported(int feature) Returns whether an feature is supported.- Parameters:
feature- which feature to query. It can be a combination ofFEATURE_FUNCTIONandFEATURE_CLASS.
-
parseExpression
Expression parseExpression(XelContext ctx, String expression, Class<?> expectedType) throws XelException Prepares (a.k.a., compiles) an expression.- Parameters:
ctx- 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
Evaluates an expression.- Parameters:
ctx- 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
-