Package org.zkoss.zk.xel.impl
Class SimpleEvaluator
java.lang.Object
org.zkoss.zk.xel.impl.SimpleEvaluator
- All Implemented Interfaces:
Serializable,Evaluator
A simple implementation of
Evaluator.- Since:
- 3.0.0
- Author:
- tomyeh
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleEvaluator(org.zkoss.xel.FunctionMapper mapper, Class<? extends org.zkoss.xel.ExpressionFactory> expfcls) -
Method Summary
Modifier and TypeMethodDescriptionEvaluates the expression.Evaluates the expression.protected org.zkoss.xel.ExpressionFactoryReturns the expression factory.Class<? extends org.zkoss.xel.ExpressionFactory>Returns the implementation class of the expression factory, or null to use the default.org.zkoss.xel.FunctionMappergetFunctionMapper(Object ref) Returns the function mapper, or null if not available.org.zkoss.xel.VariableResolverReturns the variable resolver, or null if not available.protected org.zkoss.xel.XelContextnewXelContext(Object ref) Instantiate a XEL context.org.zkoss.xel.ExpressionparseExpression(String expression, Class expectedType) Prepares the expression.
-
Constructor Details
-
SimpleEvaluator
public SimpleEvaluator(org.zkoss.xel.FunctionMapper mapper, Class<? extends org.zkoss.xel.ExpressionFactory> expfcls) - Parameters:
expfcls- the class that implements the expression factory. If null, the default one is used.
-
-
Method Details
-
parseExpression
public org.zkoss.xel.Expression parseExpression(String expression, Class expectedType) throws org.zkoss.xel.XelException 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:
org.zkoss.xel.XelException
-
evaluate
public Object evaluate(Page page, org.zkoss.xel.Expression expression) throws org.zkoss.xel.XelException Description copied from interface:EvaluatorEvaluates the expression. -
evaluate
public Object evaluate(Component comp, org.zkoss.xel.Expression expression) throws org.zkoss.xel.XelException Description copied from interface:EvaluatorEvaluates the expression. -
getExpressionFactoryClass
Returns the implementation class of the expression factory, or null to use the default. -
getExpressionFactory
protected org.zkoss.xel.ExpressionFactory 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)
-