freemarker.template.instruction
Class NoParseInstruction

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

public final class NoParseInstruction
extends java.lang.Object
implements UnparsedInstruction, java.io.Serializable

An instruction for containing an arbitrary block of text that is not parsed any further by FM-Classic.

Version:
$Id: NoParseInstruction.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
NoParseInstruction()
          Default constructor.
 
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?
 TemplateProcessor.ExitStatus process(TemplateProcessorParameters p)
          Process this <noparse> instruction.
 void setText(java.lang.String text)
          Sets the text to be output when evaluating this instruction.
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NoParseInstruction

public NoParseInstruction()
Default constructor.

Method Detail

setText

public void setText(java.lang.String text)
Sets the text to be output when evaluating this instruction.

Specified by:
setText in interface UnparsedInstruction
Parameters:
text - the text to be output

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

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(UnparsedInstruction) 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

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 noparse end instruction, otherwise false

process

public TemplateProcessor.ExitStatus process(TemplateProcessorParameters p)
                                     throws java.io.IOException
Process this <noparse> 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

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