freemarker.template.instruction
Class GenericStartInstruction

java.lang.Object
  extended by freemarker.template.instruction.GenericStartInstruction
All Implemented Interfaces:
ContainerInstruction, Instruction, TemplateProcessor, java.io.Serializable
Direct Known Subclasses:
AssignBlockInstruction, FunctionInstruction, ListInstruction, LocalInstruction, TransformInstruction

public abstract class GenericStartInstruction
extends java.lang.Object
implements Instruction, TemplateProcessor, ContainerInstruction, java.io.Serializable

A superclass for instructions that have a body and a single end instruction, and that can produce output.

Version:
$Id: GenericStartInstruction.java 1101 2013-04-01 04:17: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
protected  TemplateProcessor body
          The template body to be processed
 
Constructor Summary
GenericStartInstruction()
           
 
Method Summary
 TemplateProcessor callBuilder(TemplateBuilder builder)
          A TemplateBuilder can call this method to have an Instruction call it back to be built.
 Instruction.EndType getEndType()
          Determine what type of end instruction this is, if any.
 boolean isEndInstruction()
          Is this an end instruction?
 void setBody(TemplateProcessor body)
          Sets the body to be generated by this instruction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface freemarker.template.TemplateProcessor
process
 
Methods inherited from interface freemarker.template.instruction.ContainerInstruction
testEndInstruction
 

Field Detail

body

protected TemplateProcessor body
The template body to be processed

Constructor Detail

GenericStartInstruction

public GenericStartInstruction()
Method Detail

isEndInstruction

public boolean isEndInstruction()
Is this an end instruction?

Specified by:
isEndInstruction in interface Instruction
Returns:
false, indicating that this is not an end instruction

getEndType

public Instruction.EndType getEndType()
Determine what type of end instruction this is, if any.

Specified by:
getEndType in interface Instruction
Returns:
NONE, indicating that this is not an end instruction

setBody

public void setBody(TemplateProcessor body)
Sets the body to be generated by this instruction.

Parameters:
body - the content to be generated

callBuilder

public TemplateProcessor callBuilder(TemplateBuilder builder)
                              throws ParseException
A TemplateBuilder can call this method to have an Instruction call it back to be built. This implementation calls the TemplateBuilder.buildStatement(GenericStartInstruction) method, passing back a reference to itself. This approach is intended to make type-checking of Instruction objects unnecessary.

Specified by:
callBuilder in interface Instruction
Parameters:
builder - the builder to be called back by this method
Throws:
ParseException