freemarker.template.instruction
Class AssignInstruction
java.lang.Object
|
+--freemarker.template.instruction.EmptyInstruction
|
+--freemarker.template.instruction.AssignInstruction
- All Implemented Interfaces:
- Instruction, java.io.Serializable, TemplateProcessor
- public final class AssignInstruction
- extends EmptyInstruction
- implements java.io.Serializable
An instruction that assigns a literal or reference to a single-identifier
variable.
- Version:
- $Id: AssignInstruction.java,v 1.25 2003/11/27 11:36:45 run2000 Exp $
- See Also:
- Serialized Form
Fields inherited from interface freemarker.template.instruction.Instruction |
BREAK, CASE, COMMENT_END, COMPRESS_END, DEFAULT, ELSE, ELSEIF, FOREACH_END, FUNCTION_END, IF_END, LIST_END, NONE, NOPARSE_END, SWITCH_END, TRANSFORM_END |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AssignInstruction
public AssignInstruction(Identifier variable,
Expression value)
- Constructor that takes a vairable to be assigned and the expression
whose value should be assigned.
- Parameters:
variable
- the variable to assign to.value
- the expression to assign.- Throws:
NullPointerException
- the variable or value is nulljava.lang.IllegalArgumentException
- attempt to assign variable to an iterator
process
public void process(TemplateModelRoot modelRoot,
java.io.Writer out,
TemplateRuntimeHandler eventHandler)
throws java.io.IOException
- Process this
<assign ... >
instruction.
- Parameters:
modelRoot
- the root node of the data modelout
- a Writer
to send the output toeventHandler
- a TemplateEventAdapter
for handling any
events that occur 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