freemarker.template.instruction
Class AssignBlockInstruction

java.lang.Object
  extended by freemarker.template.instruction.GenericStartInstruction
      extended by freemarker.template.instruction.AssignBlockInstruction
All Implemented Interfaces:
ContainerInstruction, Instruction, TemplateProcessor, java.io.Serializable

public final class AssignBlockInstruction
extends GenericStartInstruction
implements java.io.Serializable

An instruction that assigns a template block to a single-identifier variable.

Since:
1.9
Version:
$Id: AssignBlockInstruction.java 1162 2013-04-20 12:04:32Z 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
 
Field Summary
 
Fields inherited from class freemarker.template.instruction.GenericStartInstruction
body
 
Constructor Summary
AssignBlockInstruction(Variable variable)
          Constructor that takes a vairable to be assigned and the expression whose value should be assigned.
 
Method Summary
 TemplateProcessor.ExitStatus process(TemplateProcessorParameters p)
          Process this <assign ...
 boolean testEndInstruction(Instruction endInstruction)
          Is this the right kind of instruction for the given EndInstruction?
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class freemarker.template.instruction.GenericStartInstruction
callBuilder, getEndType, isEndInstruction, setBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AssignBlockInstruction

public AssignBlockInstruction(Variable variable)
Constructor that takes a vairable to be assigned and the expression whose value should be assigned.

Parameters:
variable - the variable to assign to.
Throws:
java.lang.NullPointerException - the variable or value is null
java.lang.IllegalArgumentException - attempt to assign variable to an iterator
Method Detail

process

public TemplateProcessor.ExitStatus process(TemplateProcessorParameters p)
                                     throws java.io.IOException
Process this <assign ... > block instruction.

Specified by:
process in interface TemplateProcessor
Parameters:
p - template processing parameters
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

testEndInstruction

public boolean testEndInstruction(Instruction endInstruction)
Is this the right kind of instruction for the given EndInstruction?

Specified by:
testEndInstruction in interface ContainerInstruction
Parameters:
endInstruction - the end instruction we're testing
Returns:
true if the EndInstruction is a transform end instruction, otherwise false

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