freemarker.template.instruction
Interface Instruction

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

public interface Instruction

An interface that parsed instructions must implement.


Field Summary
static int ASSIGN_END
          Constant returned by getEndType() indicating that this is an assign end instruction.
static int BREAK
          Constant returned by getEndType() indicating that this is a break instruction.
static int CASE
          Constant returned by getEndType() indicating that this is a case instruction.
static int COMMENT_END
          Constant returned by getEndType() indicating that this is a comment end instruction.
static int COMPRESS_END
          Constant returned by getEndType() indicating that this is a compress end instruction.
static int DEFAULT
          Constant returned by getEndType() indicating that this is a default instruction.
static int ELSE
          Constant returned by getEndType() indicating that this is an else instruction.
static int ELSEIF
          Constant returned by getEndType() indicating that this is an elseif instruction.
static int FOREACH_END
          Constant returned by getEndType() indicating that this is a foreach end instruction.
static int FUNCTION_END
          Constant returned by getEndType() indicating that this is a function end instruction.
static int IF_END
          Constant returned by getEndType() indicating that this is an if end instruction.
static int LIST_END
          Constant returned by getEndType() indicating that this is a list end instruction.
static int NONE
          Constant returned by getEndType() indicating that this is not an end instruction.
static int NOPARSE_END
          Constant returned by getEndType() indicating that this is a noparse end instruction.
static int SWITCH_END
          Constant returned by getEndType() indicating that this is a switch end instruction.
static int TRANSFORM_END
          Constant returned by getEndType() indicating that this is a transform end instruction.
 
Method Summary
 TemplateProcessor callBuilder(TemplateBuilder builder)
          A TemplateBuilder can call this method to have an Instruction call it back to be built.
 int getEndType()
          Retrieve the type of end instruction, if any.
 boolean isEndInstruction()
          Is this an end instruction?
 

Field Detail

NONE

static final int NONE
Constant returned by getEndType() indicating that this is not an end instruction.

See Also:
Constant Field Values

BREAK

static final int BREAK
Constant returned by getEndType() indicating that this is a break instruction.

See Also:
Constant Field Values

CASE

static final int CASE
Constant returned by getEndType() indicating that this is a case instruction.

See Also:
Constant Field Values

COMPRESS_END

static final int COMPRESS_END
Constant returned by getEndType() indicating that this is a compress end instruction.

See Also:
Constant Field Values

ELSE

static final int ELSE
Constant returned by getEndType() indicating that this is an else instruction.

See Also:
Constant Field Values

FUNCTION_END

static final int FUNCTION_END
Constant returned by getEndType() indicating that this is a function end instruction.

See Also:
Constant Field Values

IF_END

static final int IF_END
Constant returned by getEndType() indicating that this is an if end instruction.

See Also:
Constant Field Values

LIST_END

static final int LIST_END
Constant returned by getEndType() indicating that this is a list end instruction.

See Also:
Constant Field Values

SWITCH_END

static final int SWITCH_END
Constant returned by getEndType() indicating that this is a switch end instruction.

See Also:
Constant Field Values

COMMENT_END

static final int COMMENT_END
Constant returned by getEndType() indicating that this is a comment end instruction.

See Also:
Constant Field Values

FOREACH_END

static final int FOREACH_END
Constant returned by getEndType() indicating that this is a foreach end instruction.

See Also:
Constant Field Values

NOPARSE_END

static final int NOPARSE_END
Constant returned by getEndType() indicating that this is a noparse end instruction.

See Also:
Constant Field Values

TRANSFORM_END

static final int TRANSFORM_END
Constant returned by getEndType() indicating that this is a transform end instruction.

See Also:
Constant Field Values

ELSEIF

static final int ELSEIF
Constant returned by getEndType() indicating that this is an elseif instruction.

See Also:
Constant Field Values

DEFAULT

static final int DEFAULT
Constant returned by getEndType() indicating that this is a default instruction.

See Also:
Constant Field Values

ASSIGN_END

static final int ASSIGN_END
Constant returned by getEndType() indicating that this is an assign end instruction.

See Also:
Constant Field Values
Method Detail

isEndInstruction

boolean isEndInstruction()
Is this an end instruction?

Returns:
true if this instruction marks the end of a statement, otherwise false

getEndType

int getEndType()
Retrieve the type of end instruction, if any.

Returns:
the type of this instruction if it is an end instruction, otherwise NONE.

callBuilder

TemplateProcessor callBuilder(TemplateBuilder builder)
                              throws ParseException
A TemplateBuilder can call this method to have an Instruction call it back to be built. The Instruction will call the appropriate TemplateBuilder.buildStatement() method for its subclass, passing back a reference to itself. This approach is intended to make type-checking of Instruction objects unnecessary.

Parameters:
builder - the builder to be called back by this method
Throws:
ParseException