freemarker.template.instruction
Class TextBlockInstruction

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

public final class TextBlockInstruction
extends java.lang.Object
implements Instruction, TemplateProcessor, java.io.Serializable

A TemplateProcessor representing a block of plain text.

Version:
$Id: TextBlockInstruction.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
 
Constructor Summary
TextBlockInstruction(java.lang.String text)
          Constructor that takes a block of text to be output.
 
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()
          Retrieve the type of end instruction, if any.
 boolean isEndInstruction()
          Is this an end instruction?
 TemplateProcessor.ExitStatus process(TemplateProcessorParameters p)
          Outputs the text.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextBlockInstruction

public TextBlockInstruction(java.lang.String text)
Constructor that takes a block of text to be output.

Parameters:
text - the text block to be output at run time.
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()
Retrieve the type of end instruction, if any.

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

callBuilder

public TemplateProcessor callBuilder(TemplateBuilder builder)
A TemplateBuilder can call this method to have an Instruction call it back to be built. This implementation returns immediately, since there is nothing additional to be parsed within this instruction.

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

process

public TemplateProcessor.ExitStatus process(TemplateProcessorParameters p)
                                     throws java.io.IOException
Outputs the text.

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

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