Package org.zkoss.zk.xel.impl
Class ExecutionResolver
- java.lang.Object
-
- org.zkoss.zk.xel.impl.ExecutionResolver
-
- All Implemented Interfaces:
VariableResolver
,VariableResolverX
public class ExecutionResolver extends java.lang.Object implements VariableResolverX
A variable resolver that is based on the specified execution.- Since:
- 3.0.0
- Author:
- tomyeh
-
-
Constructor Summary
Constructors Constructor Description ExecutionResolver(Execution exec, VariableResolver parent)
Constructs a resolver with a parent and a page.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getSelf()
Returns the self variable.java.lang.Object
resolveVariable(java.lang.String name)
Resolves the specified variable.java.lang.Object
resolveVariable(XelContext ctx, java.lang.Object base, java.lang.Object onm)
Resolves the the given variable on the given base object.protected java.lang.Object
resolveVariable0(java.lang.Object self, XelContext ctx, java.lang.Object base, java.lang.Object onm)
void
setSelf(java.lang.Object self)
Sets the self variable.java.lang.String
toString()
-
-
-
Constructor Detail
-
ExecutionResolver
public ExecutionResolver(Execution exec, VariableResolver parent)
Constructs a resolver with a parent and a page.- Parameters:
parent
- the parent resolver (null means ignored).exec
- the current execution
-
-
Method Detail
-
setSelf
public void setSelf(java.lang.Object self)
Sets the self variable. The self variable also acts as the context to resolve other variables.
-
getSelf
public java.lang.Object getSelf()
Returns the self variable.
-
resolveVariable
public java.lang.Object resolveVariable(java.lang.String name) throws XelException
Description copied from interface:VariableResolver
Resolves the specified variable.- Specified by:
resolveVariable
in interfaceVariableResolver
- Parameters:
name
- the name of the variable to resolve- Throws:
XelException
-
resolveVariable
public java.lang.Object resolveVariable(XelContext ctx, java.lang.Object base, java.lang.Object onm)
Description copied from interface:VariableResolverX
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")
is called then (where we assume the returned object in the previous call isfoo
).- Specified by:
resolveVariable
in interfaceVariableResolverX
- Parameters:
ctx
- the context of this evaluationbase
- the base object whose property value is to be returned, or null to resolve a top-level variable.onm
- the name of the variable (or property) to resolve
-
resolveVariable0
protected java.lang.Object resolveVariable0(java.lang.Object self, XelContext ctx, java.lang.Object base, java.lang.Object onm)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-