freemarker.template
Interface TemplateProcessor

All Known Subinterfaces:
FunctionTemplateProcessor, UnparsedInstruction
All Known Implementing Classes:
AbstractTemplate, AssignBlockInstruction, AssignInstruction, BreakInstruction, CallInstruction, CaseInstruction, CommentInstruction, DefaultCaseInstruction, ElseInstruction, EmptyInstruction, ExitInstruction, FunctionInstruction, GenericStartInstruction, IfElseInstruction, IfInstruction, IncludeInstruction, ListInstruction, NOOPInstruction, NoParseInstruction, SwitchInstruction, Template, TemplateArrayList, TextBlockInstruction, TransformInstruction, UnparsedTemplate, VariableInstruction

public interface TemplateProcessor

Objects representing compiled templates must implement this interface.


Field Summary
static short BREAK
          Constant returned by process() indicating that this is the result of a break instruction.
static short EXIT
          Constant returned by process() indicating that this is the result of an exit instruction.
static short OK
          Constant returned by process() indicating that this is normal control flow.
static short UNCOMPILED_TEMPLATE
          Constant returned by process() indicating that this is the result of a break instruction.
 
Method Summary
 short process(TemplateWriteableHashModel modelRoot, java.io.Writer out, TemplateRuntimeHandler eventHandler)
          Processes the contents of this TemplateProcessor and outputs the resulting text to a Writer.
 

Field Detail

OK

static final short OK
Constant returned by process() indicating that this is normal control flow.

See Also:
Constant Field Values

BREAK

static final short BREAK
Constant returned by process() indicating that this is the result of a break instruction.

See Also:
Constant Field Values

EXIT

static final short EXIT
Constant returned by process() indicating that this is the result of an exit instruction.

See Also:
Constant Field Values

UNCOMPILED_TEMPLATE

static final short UNCOMPILED_TEMPLATE
Constant returned by process() indicating that this is the result of a break instruction.

See Also:
Constant Field Values
Method Detail

process

short process(TemplateWriteableHashModel modelRoot,
              java.io.Writer out,
              TemplateRuntimeHandler eventHandler)
              throws java.io.IOException
Processes the contents of this TemplateProcessor and outputs the resulting text to a Writer.

Parameters:
modelRoot - the root node of the data model.
out - a Writer to send the output to.
eventHandler - a TemplateEventAdapter for handling any events that occur during processing.
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