freemarker.template.instruction
Class VariableInstruction

java.lang.Object
  extended by freemarker.template.instruction.EmptyInstruction
      extended by freemarker.template.instruction.VariableInstruction
All Implemented Interfaces:
Instruction, TemplateProcessor, java.io.Serializable

public final class VariableInstruction
extends EmptyInstruction
implements java.io.Serializable

An instruction that outputs the value of a Variable.

Version:
$Id: VariableInstruction.java 1124 2005-10-04 10:48:45Z run2000 $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface freemarker.template.instruction.Instruction
Instruction.EndType
 
Nested classes/interfaces inherited from interface freemarker.template.TemplateProcessor
TemplateProcessor.ExitStatus
 
Constructor Summary
VariableInstruction(Expression expression)
          Constructor that takes a Expression to be output.
 
Method Summary
 TemplateProcessor.ExitStatus process(TemplateWriteableHashModel modelRoot, java.io.Writer out, TemplateRuntimeHandler eventHandler)
          Process this ${ ...
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class freemarker.template.instruction.EmptyInstruction
callBuilder, getEndType, isEndInstruction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VariableInstruction

public VariableInstruction(Expression expression)
Constructor that takes a Expression to be output.

Parameters:
expression - the expression to be output
Throws:
java.lang.NullPointerException - the expression was null
java.lang.IllegalArgumentException - the expression was not a scalar nor a number
Method Detail

process

public TemplateProcessor.ExitStatus process(TemplateWriteableHashModel modelRoot,
                                            java.io.Writer out,
                                            TemplateRuntimeHandler eventHandler)
                                     throws java.io.IOException
Process this ${ ... } instruction.

Specified by:
process in interface TemplateProcessor
Parameters:
modelRoot - the root node of the data model.
out - a Writer to send the output to.
eventHandler - a TemplateEventAdapter for handling any events that occur during processing.
Returns:
an exit code indicating how the process terminated, typically used for short-circuiting template processing
Throws:
java.io.IOException - an IO error occurred during processing

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
a String representing this instruction subtree