org.zkoss.xel.util
Class SimpleResolver

java.lang.Object
  extended by org.zkoss.xel.util.SimpleResolver
All Implemented Interfaces:
Serializable, VariableResolver

public class SimpleResolver
extends Object
implements VariableResolver, Serializable

A simple resolver that retrieve variable from a map.

Note: since 5.0.8, it becomes serializable. Thus, the parent and vars parameter of SimpleResolver(VariableResolver, Map) have to serializable in the clustering environment.

Since:
3.0.0
Author:
tomyeh
See Also:
Serialized Form

Field Summary
protected  Map _vars
          The variable maps.
 
Constructor Summary
SimpleResolver()
          Constructs a resolver.
SimpleResolver(Map vars)
          Constructs a resolver with an object map.
SimpleResolver(VariableResolver parent)
          Constructs a resolver with a parent.
SimpleResolver(VariableResolver parent, Map vars)
          Constructs a resolver with a parent and an object map.
 
Method Summary
 VariableResolver getParent()
          Returns the parent, or null if no parent at all.
 Object resolveVariable(String name)
          Resolves the specified variable.
 void setParent(VariableResolver parent)
          Sets the parent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_vars

protected Map _vars
The variable maps.

Constructor Detail

SimpleResolver

public SimpleResolver()
Constructs a resolver.


SimpleResolver

public SimpleResolver(VariableResolver parent)
Constructs a resolver with a parent.

Parameters:
parent - the parent resolver (null means ignored).

SimpleResolver

public SimpleResolver(VariableResolver parent,
                      Map vars)
Constructs a resolver with a parent and an object map.

Parameters:
parent - the parent resolver (null means ignored).
vars - the object map (null means ignored)

SimpleResolver

public SimpleResolver(Map vars)
Constructs a resolver with an object map.

Parameters:
vars - the object map (null means ignored)
Method Detail

getParent

public VariableResolver getParent()
Returns the parent, or null if no parent at all.


setParent

public void setParent(VariableResolver parent)
Sets the parent.

Parameters:
parent - the parent resolver, or null if no parent.

resolveVariable

public Object resolveVariable(String name)
                       throws XelException
Description copied from interface: VariableResolver
Resolves the specified variable.

Specified by:
resolveVariable in interface VariableResolver
Parameters:
name - the name of the variable to resolve
Throws:
XelException


Copyright © 2011. All Rights Reserved.