Package org.zkoss.xel.util

## Class SimpleResolver

- java.lang.Object
- - org.zkoss.xel.util.SimpleResolver

- All Implemented Interfaces:
    `java.io.Serializable`, `VariableResolver`

      public class SimpleResolver
      extends java.lang.Object
      implements VariableResolver, java.io.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

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected java.util.Map<java.lang.String,​?>` | `_vars` | The variable maps.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SimpleResolver()` | Constructs a resolver.
    `SimpleResolver​(java.util.Map<java.lang.String,​?> vars)` | Constructs a resolver with an object map.
    `SimpleResolver​(VariableResolver parent)` | Constructs a resolver with a parent.
    `SimpleResolver​(VariableResolver parent, java.util.Map<java.lang.String,​?> vars)` | Constructs a resolver with a parent and an object map.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `VariableResolver` | `getParent()` | Returns the parent, or null if no parent at all.
    `java.lang.Object` | `resolveVariable​(java.lang.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 java.util.Map<java.lang.String,​?> _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,
                                java.util.Map<java.lang.String,​?> 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​(java.util.Map<java.lang.String,​?> 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 java.lang.Object resolveVariable​(java.lang.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`