freemarker.template.expression
Interface Variable

All Superinterfaces:
Expression
All Known Implementing Classes:
Dot, DynamicKeyName, Identifier, MethodCall

public interface Variable
extends Expression

An interface for expressions that get their values from the data model, and for those data models that can be set to a value.

Version:
$Id: Variable.java 1101 2013-04-01 04:17:32Z run2000 $

Method Summary
 java.lang.String getName(TemplateWriteableHashModel modelRoot)
          Retrieve the name of this portion of the variable.
 void setTemplateModel(TemplateWriteableHashModel modelRoot, TemplateModel value)
          Sets the specified value to the result of this expression.
 
Methods inherited from interface freemarker.template.expression.Expression
getAsTemplateModel, getType, isComplete, isConstant, resolveExpression
 

Method Detail

getName

java.lang.String getName(TemplateWriteableHashModel modelRoot)
                         throws TemplateException
Retrieve the name of this portion of the variable.

Parameters:
modelRoot - the model to be used in cases where the variable is the result of an Expression.
Throws:
TemplateException - the name could not be determined

setTemplateModel

void setTemplateModel(TemplateWriteableHashModel modelRoot,
                      TemplateModel value)
                      throws TemplateException
Sets the specified value to the result of this expression. An exception may be thrown depending on whether the model evaluated by this expression is assignable, and whether the model itself throws an exception.

Parameters:
modelRoot - the model to be used in cases where the variable is the result of an Expression
value - the value to be assigned
Throws:
TemplateException - the value could not be assigned to the model