Packageorg.spicefactory.lib.expr.impl
Classpublic class ChainedVariableResolver
InheritanceChainedVariableResolver Inheritance Object
Implements VariableResolver

VariableResolver implementation that chains multiple VariableResolvers. For resolving variables this implementation will delegate the task to each of the chained VariableResolver instances until one of them is able to resolve the variable. The order of execution corresponds to the order in which VariableResolver instances were added.



Public Methods
 MethodDefined By
  
Creates a new instance.
ChainedVariableResolver
  
Adds the specified VariableResolver instance to the internal chain.
ChainedVariableResolver
  
resolveVariable(variableName:String):*
Resolves the variable with the specified name.
ChainedVariableResolver
Constructor Detail
ChainedVariableResolver()Constructor
public function ChainedVariableResolver()

Creates a new instance.

Method Detail
addResolver()method
public function addResolver(resolver:VariableResolver):void

Adds the specified VariableResolver instance to the internal chain.

Parameters

resolver:VariableResolver — the resolver to add to the internal chain.

resolveVariable()method 
public function resolveVariable(variableName:String):*

Resolves the variable with the specified name. If the variable cannot be resolved this method should return undefined.

Parameters

variableName:String — the name of the variable to resolve

Returns
* — the value associated with the specified variable name or undefined if the variable cannot be resolved