freemarker.template.compiler
Class LinkedListTemplateBuilder

java.lang.Object
  extended by 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 built a TemplateLinkedList.

Version:
$Id: LinkedListTemplateBuilder.java 1107 2013-04-12 02:00:10Z run2000 $

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(BreakInstruction instruction)
          When an implementation of TemplateBuilder calls Instruction.callBuilder(freemarker.template.compiler.TemplateBuilder), the Instruction will call this method if it is a BreakInstruction.
 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(ExitInstruction instruction)
          When an implementation of TemplateBuilder calls Instruction.callBuilder(freemarker.template.compiler.TemplateBuilder), the Instruction will call this method if it is an ExitInstruction.
 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(ListInstruction 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 ListInstruction.
 TemplateProcessor buildStatement(LocalInstruction instruction)
          When an implementation of TemplateBuilder calls Instruction.callBuilder(freemarker.template.compiler.TemplateBuilder), the Instruction will call this method if it is a LocalInstruction.
 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.
Throws:
ParseException

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.
Throws:
ParseException

buildStatement

public TemplateProcessor buildStatement(ListInstruction 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 ListInstruction.

Specified by:
buildStatement in interface TemplateBuilder
Parameters:
instruction - the Instruction on which callBuilder() was called.
Throws:
ParseException

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.
Throws:
ParseException

buildStatement

public TemplateProcessor buildStatement(LocalInstruction instruction)
                                 throws ParseException
When an implementation of TemplateBuilder calls Instruction.callBuilder(freemarker.template.compiler.TemplateBuilder), the Instruction will call this method if it is a LocalInstruction.

Specified by:
buildStatement in interface TemplateBuilder
Parameters:
instruction - the Instruction on which callBuilder() was called.
Throws:
ParseException

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.
Throws:
ParseException

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.
Throws:
ParseException

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.
Throws:
ParseException

buildStatement

public TemplateProcessor buildStatement(BreakInstruction instruction)
                                 throws ParseException
When an implementation of TemplateBuilder calls Instruction.callBuilder(freemarker.template.compiler.TemplateBuilder), the Instruction will call this method if it is a BreakInstruction.

Specified by:
buildStatement in interface TemplateBuilder
Parameters:
instruction - the Instruction on which callBuilder() was called.
Throws:
ParseException

buildStatement

public TemplateProcessor buildStatement(ExitInstruction instruction)
                                 throws ParseException
When an implementation of TemplateBuilder calls Instruction.callBuilder(freemarker.template.compiler.TemplateBuilder), the Instruction will call this method if it is an ExitInstruction.

Specified by:
buildStatement in interface TemplateBuilder
Parameters:
instruction - the Instruction on which callBuilder() was called.
Throws:
ParseException