freemarker.template.instruction
Class GenericStartInstruction
java.lang.Object
|
+--freemarker.template.instruction.GenericStartInstruction
- All Implemented Interfaces:
- ContainerInstruction, Instruction, java.io.Serializable, TemplateProcessor
- Direct Known Subclasses:
- FunctionInstruction, ListInstruction, 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,v 1.12 2003/11/10 10:01:22 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, toString, wait, wait, wait |
body
protected TemplateProcessor body
- The template body to be processed
GenericStartInstruction
public GenericStartInstruction()
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 int 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