org.zkoss.xel
Interface VariableResolverX

All Superinterfaces:
VariableResolver
All Known Implementing Classes:
DelegatingVariableResolver, ExecutionResolver

public interface VariableResolverX
extends VariableResolver

An extension of VariableResolver to have more control to resolve the variables.

With VariableResolver, VariableResolver.resolveVariable(java.lang.String) is called to resolve a top-level variable (for example, ${a.b.c} where a is a top-level variable).

With VariableResolverX, resolveVariable(XelContext, Object, Object) is called to resolve not only top-level variables but also properties (for example, ${a.b.c} where b and c are properties).

If VariableResolverX is implemented, VariableResolver.resolveVariable(java.lang.String) is ignored. In other words, EL evaluator always invoke resolveVariable(XelContext, Object, Object).

Notice you have to follow the same rule to invoke the resolveVariable method. 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.

Since:
5.0.0
Author:
tomyeh

Method Summary
 java.lang.Object resolveVariable(XelContext ctx, java.lang.Object base, java.lang.Object name)
          Resolves the the given variable on the given base object.
 
Methods inherited from interface org.zkoss.xel.VariableResolver
resolveVariable
 

Method Detail

resolveVariable

java.lang.Object resolveVariable(XelContext ctx,
                                 java.lang.Object base,
                                 java.lang.Object name)
                                 throws XelException
Resolves the the given variable on the given base object.

It resolves not only top-level variables but also properties. For example, when resolving foo.duke, 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 foo).

Parameters:
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
Throws:
XelException


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo