public interface VariableResolverX extends VariableResolver
VariableResolverto have more control to resolve the variables.
is called to resolve a top-level variable (for example,
a is a top-level variable).
VariableResolverX is implemented,
is ignored. In other words, EL evaluator always invoke
resolveVariable(XelContext, Object, Object).
Notice you have to follow the same rule to invoke the
And there is a method called
Evaluators.resolveVariable(org.zkoss.xel.XelContext, org.zkoss.xel.VariableResolver, java.lang.Object, java.lang.Object)
that can be used to do the job.
|Modifier and Type||Method and Description|
Resolves the the given variable on the given base object.
java.lang.Object resolveVariable(XelContext ctx, java.lang.Object base, java.lang.Object name) throws XelException
It resolves not only top-level variables but also properties.
For example, when resolving
resolveVariable(ctx, null, "foo") is called first.
And if it returns an non-null object,
resolveVariable(ctx, foo, "duke"),/code> is called then
(where we assume the returned object in the previous call is
ctx- the context of this evaluation
base- the base object whose property value is to be returned, or null to resolve a top-level variable.
name- the name of the variable (or property) to resolve
Copyright © 2005-2022 Potix Corporation. All Rights Reserved.