freemarker.template.instruction
Class ExitInstruction

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

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

An instruction that represents an exit point from a function.

Note:
ExitInstruction is a singleton instance. Use the getInstance() method to retrieve instances of this instruction.

Since:
1.8.2
Version:
$Id: ExitInstruction.java 1162 2013-04-20 12:04:32Z run2000 $
See Also:
CallInstruction, FunctionInstruction, FunctionModel, 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
 
Method Summary
 TemplateProcessor callBuilder(TemplateBuilder builder)
          A TemplateBuilder can call this method to have an Instruction call it back to be built.
static ExitInstruction getInstance()
          Retrieves a singleton instance of ExitInstruction.
 TemplateProcessor.ExitStatus process(TemplateProcessorParameters p)
          Processes the contents of this TemplateProcessor and outputs the resulting text to a Writer.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class freemarker.template.instruction.EmptyInstruction
getEndType, isEndInstruction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static ExitInstruction getInstance()
Retrieves a singleton instance of ExitInstruction.

Returns:
a singleton ExitInstruction

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 returns immediately, since there is nothing additional to be parsed within this instruction.

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

process

public TemplateProcessor.ExitStatus process(TemplateProcessorParameters p)
Processes the contents of this TemplateProcessor and outputs the resulting text to a Writer. This implementation returns immediately, since there is nothing to output.

Specified by:
process in interface TemplateProcessor
Parameters:
p - template processing parameters
Returns:
ExitStatus.EXIT, to indicate this is an exit instruction

toString

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

Overrides:
toString in class java.lang.Object
Returns:
the String "exit"