Package org.zkoss.zk.xel.impl
Class SimpleEvaluator
java.lang.Object
org.zkoss.zk.xel.impl.SimpleEvaluator
- All Implemented Interfaces:
Serializable,Evaluator
- Direct Known Subclasses:
BindEvaluatorXImpl
A simple implementation of
Evaluator.- Since:
- 3.0.0
- Author:
- tomyeh
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleEvaluator(FunctionMapper mapper, Class<? extends ExpressionFactory> expfcls) -
Method Summary
Modifier and TypeMethodDescriptionevaluate(Component comp, Expression expression) Evaluates the expression.evaluate(Page page, Expression expression) Evaluates the expression.protected ExpressionFactoryReturns the expression factory.Class<? extends ExpressionFactory>Returns the implementation class of the expression factory, or null to use the default.getFunctionMapper(Object ref) Returns the function mapper, or null if not available.Returns the variable resolver, or null if not available.protected XelContextnewXelContext(Object ref) Instantiate a XEL context.parseExpression(String expression, Class expectedType) Prepares the expression.
-
Constructor Details
-
SimpleEvaluator
- Parameters:
expfcls- the class that implements the expression factory. If null, the default one is used.
-
-
Method Details
-
parseExpression
Description copied from interface:EvaluatorPrepares the expression.- Specified by:
parseExpressionin interfaceEvaluator- Parameters:
expression- the expression to be prepared for being evaluated later.expectedType- the expected type of the result of the evaluation- Throws:
XelException
-
evaluate
Description copied from interface:EvaluatorEvaluates the expression.- Specified by:
evaluatein interfaceEvaluator- Parameters:
page- the page, or null to ignore- Throws:
XelException
-
evaluate
Description copied from interface:EvaluatorEvaluates the expression.- Specified by:
evaluatein interfaceEvaluator- Parameters:
comp- the component, or null to ignore- Throws:
XelException
-
getExpressionFactoryClass
Returns the implementation class of the expression factory, or null to use the default. -
getExpressionFactory
Returns the expression factory. -
newXelContext
Instantiate a XEL context. Don't reuse it since it has attributes (that shall not be kept after evaluation). -
getFunctionMapper
Returns the function mapper, or null if not available.Default: returns the function mapper passed thru
SimpleEvaluator(org.zkoss.xel.FunctionMapper, java.lang.Class<? extends org.zkoss.xel.ExpressionFactory>).- Parameters:
ref- the object,either page, component, or null. It is passed toevaluate(org.zkoss.zk.ui.Page, org.zkoss.xel.Expression)
-
getVariableResolver
Returns the variable resolver, or null if not available.Default: it returns the variable resolver of the current execution, if any. Otherwise, it returns the current
RequestContext, if any. If both not available, null is returned.- Parameters:
ref- the object,either page, component, or null. It is passed toevaluate(org.zkoss.zk.ui.Page, org.zkoss.xel.Expression)
-