public class SimpleEvaluator extends java.lang.Object implements Evaluator
Evaluator
.Constructor and Description |
---|
SimpleEvaluator(FunctionMapper mapper,
java.lang.Class<? extends ExpressionFactory> expfcls) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
evaluate(Component comp,
Expression expression)
Evaluates the expression.
|
java.lang.Object |
evaluate(Page page,
Expression expression)
Evaluates the expression.
|
protected ExpressionFactory |
getExpressionFactory()
Returns the expression factory.
|
java.lang.Class<? extends ExpressionFactory> |
getExpressionFactoryClass()
Returns the implementation class of the expression factory,
or null to use the default.
|
FunctionMapper |
getFunctionMapper(java.lang.Object ref)
Returns the function mapper, or null if not available.
|
VariableResolver |
getVariableResolver(java.lang.Object ref)
Returns the variable resolver, or null if not available.
|
protected XelContext |
newXelContext(java.lang.Object ref)
Instantiate a XEL context.
|
Expression |
parseExpression(java.lang.String expression,
java.lang.Class expectedType)
Prepares the expression.
|
public SimpleEvaluator(FunctionMapper mapper, java.lang.Class<? extends ExpressionFactory> expfcls)
expfcls
- the class that implements the expression factory.
If null, the default one is used.public Expression parseExpression(java.lang.String expression, java.lang.Class expectedType) throws XelException
Evaluator
parseExpression
in interface Evaluator
expression
- the expression to be prepared for being evaluated
later.expectedType
- the expected type of the result of the evaluationXelException
public java.lang.Object evaluate(Page page, Expression expression) throws XelException
Evaluator
evaluate
in interface Evaluator
page
- the page, or null to ignoreXelException
public java.lang.Object evaluate(Component comp, Expression expression) throws XelException
Evaluator
evaluate
in interface Evaluator
comp
- the component, or null to ignoreXelException
public java.lang.Class<? extends ExpressionFactory> getExpressionFactoryClass()
protected ExpressionFactory getExpressionFactory()
protected XelContext newXelContext(java.lang.Object ref)
public FunctionMapper getFunctionMapper(java.lang.Object ref)
Default: returns the function mapper passed thru
SimpleEvaluator(org.zkoss.xel.FunctionMapper, java.lang.Class<? extends org.zkoss.xel.ExpressionFactory>)
.
ref
- the object,either page, component, or null.
It is passed to evaluate(org.zkoss.zk.ui.Page, org.zkoss.xel.Expression)
public VariableResolver getVariableResolver(java.lang.Object ref)
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.
ref
- the object,either page, component, or null.
It is passed to evaluate(org.zkoss.zk.ui.Page, org.zkoss.xel.Expression)
Copyright © 2005-2023 Potix Corporation. All Rights Reserved.