freemarker.template.compiler
Class LinkedListTemplateBuilder

java.lang.Object
  |
  +--freemarker.template.compiler.LinkedListTemplateBuilder
All Implemented Interfaces:
TemplateBuilder

public final class LinkedListTemplateBuilder
extends java.lang.Object
implements TemplateBuilder

Builds a template as a tree structure in which child nodes are stored in TemplateArrayLists. Each instance can be used to compile one template.

This class is now misnamed,since it originally build a TemplateLinkedList.

Version:
$Id: LinkedListTemplateBuilder.java,v 1.22 2003/11/10 03:55:37 run2000 Exp $

Constructor Summary
LinkedListTemplateBuilder(FunctionTemplateProcessor template, TemplateParser parser)
          Constructs a new LinkedListTemplateBuilder with a FunctionTemplateProcessor and a TemplateParser.
 
Method Summary
 TemplateProcessor build()
          Builds the template.
 TemplateProcessor buildStatement(EmptyInstruction instruction)
          When this TemplateBuilder implementation calls Instruction.callBuilder(freemarker.template.compiler.TemplateBuilder), the Instruction will call this method if it is an EmptyInstruction.
 TemplateProcessor buildStatement(FunctionInstruction instruction)
          When this TemplateBuilder implementation calls Instruction.callBuilder(freemarker.template.compiler.TemplateBuilder), the Instruction will call this method if it is a FunctionInstruction.
 TemplateProcessor buildStatement(GenericStartInstruction instruction)
          When this TemplateBuilder implementation calls Instruction.callBuilder(freemarker.template.compiler.TemplateBuilder), the Instruction will call this method if it should be built as a GenericStartInstruction.
 TemplateProcessor buildStatement(IfElseInstruction instruction)
          When this TemplateBuilder implementation calls Instruction.callBuilder(freemarker.template.compiler.TemplateBuilder), the Instruction will call this method if it is an IfInstruction.
 TemplateProcessor buildStatement(SwitchInstruction instruction)
          When this TemplateBuilder implementation calls Instruction.callBuilder(freemarker.template.compiler.TemplateBuilder), the Instruction will call this method if it is a SwitchInstruction.
 TemplateProcessor buildStatement(UnparsedInstruction instruction)
          When this TemplateBuilder implementation calls Instruction.callBuilder(freemarker.template.compiler.TemplateBuilder), the Instruction will call this method if it is an UnparsedInstruction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkedListTemplateBuilder

public LinkedListTemplateBuilder(FunctionTemplateProcessor template,
                                 TemplateParser parser)
Constructs a new LinkedListTemplateBuilder with a FunctionTemplateProcessor and a TemplateParser.
Parameters:
template - the template to be built
parser - the parser to parse the input stream
Method Detail

build

public TemplateProcessor build()
                        throws ParseException
Builds the template.
Specified by:
build in interface TemplateBuilder
Returns:
the head of the built template.
Throws:
ParseException - the template could not be built

buildStatement

public TemplateProcessor buildStatement(EmptyInstruction instruction)
                                 throws ParseException
When this TemplateBuilder implementation calls Instruction.callBuilder(freemarker.template.compiler.TemplateBuilder), the Instruction will call this method if it is an EmptyInstruction.
Specified by:
buildStatement in interface TemplateBuilder
Parameters:
instruction - the Instruction on which callBuilder() was called.

buildStatement

public TemplateProcessor buildStatement(GenericStartInstruction instruction)
                                 throws ParseException
When this TemplateBuilder implementation calls Instruction.callBuilder(freemarker.template.compiler.TemplateBuilder), the Instruction will call this method if it should be built as a GenericStartInstruction.
Specified by:
buildStatement in interface TemplateBuilder
Parameters:
instruction - the Instruction on which callBuilder() was called.

buildStatement

public TemplateProcessor buildStatement(FunctionInstruction instruction)
                                 throws ParseException
When this TemplateBuilder implementation calls Instruction.callBuilder(freemarker.template.compiler.TemplateBuilder), the Instruction will call this method if it is a FunctionInstruction.
Specified by:
buildStatement in interface TemplateBuilder
Parameters:
instruction - the Instruction on which callBuilder() was called.

buildStatement

public TemplateProcessor buildStatement(IfElseInstruction instruction)
                                 throws ParseException
When this TemplateBuilder implementation calls Instruction.callBuilder(freemarker.template.compiler.TemplateBuilder), the Instruction will call this method if it is an IfInstruction.
Specified by:
buildStatement in interface TemplateBuilder
Parameters:
instruction - the Instruction on which callBuilder() was called.

buildStatement

public TemplateProcessor buildStatement(SwitchInstruction instruction)
                                 throws ParseException
When this TemplateBuilder implementation calls Instruction.callBuilder(freemarker.template.compiler.TemplateBuilder), the Instruction will call this method if it is a SwitchInstruction.
Specified by:
buildStatement in interface TemplateBuilder
Parameters:
instruction - the Instruction on which callBuilder() was called.

buildStatement

public TemplateProcessor buildStatement(UnparsedInstruction instruction)
                                 throws ParseException
When this TemplateBuilder implementation calls Instruction.callBuilder(freemarker.template.compiler.TemplateBuilder), the Instruction will call this method if it is an UnparsedInstruction.
Specified by:
buildStatement in interface TemplateBuilder
Parameters:
instruction - the Instruction on which callBuilder() was called.