|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--freemarker.template.instruction.DefaultCaseInstruction
Represents a case in a switch statement. Unexpectedly, this is a superclass
for the regular CaseInstruction
class.
CaseInstruction
,
SwitchInstruction
, Serialized FormField Summary | |
protected TemplateProcessor |
body
The template body to process if the default case is reached. |
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 |
Constructor Summary | |
DefaultCaseInstruction()
Default constructor. |
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. |
Expression |
getExpression()
Retrieves the Expression to be
evaluated when the case instruction is encountered. |
boolean |
hasBreak()
Does this case instruction contain a break instruction? |
boolean |
isDefault()
Is this the default case? |
boolean |
isEndInstruction()
Is this an end instruction? |
void |
process(TemplateModelRoot modelRoot,
java.io.Writer out,
TemplateRuntimeHandler eventHandler)
Process this <default> instruction. |
void |
setBody(TemplateProcessor body)
Sets the body to be processed if the case expression evaluated to true . |
void |
setBreak(boolean hasBreak)
Sets whether this case instruction contains a break instruction. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected TemplateProcessor body
Constructor Detail |
public DefaultCaseInstruction()
Method Detail |
public Expression getExpression()
Expression
to be
evaluated when the case
instruction is encountered.Expression
associated with this
CaseInstruction
public boolean isDefault()
true
if this is the default case,
otherwise false
public final void setBody(TemplateProcessor body)
true
.body
- the TemplateProcessor
to be processed if this
Case
passes the test.public void setBreak(boolean hasBreak)
hasBreak
- true
if this CaseInstruction
has a break
, otherwise false
public boolean hasBreak()
true
if this Case
has a break
instruction, otherwise false
public final boolean isEndInstruction()
isEndInstruction
in interface Instruction
true
, to indicate this is an end instructionpublic int getEndType()
getEndType
in interface Instruction
DEFAULT
public final TemplateProcessor callBuilder(TemplateBuilder builder)
TemplateBuilder
can call
this method to have an Instruction
call it back to be built.
For end instructions, there is nothing more to be build, so return
immediately.callBuilder
in interface Instruction
builder
- the builder to be called back by this methodpublic final void process(TemplateModelRoot modelRoot, java.io.Writer out, TemplateRuntimeHandler eventHandler) throws java.io.IOException
<default>
instruction.process
in interface TemplateProcessor
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.public java.lang.String toString()
toString
in class java.lang.Object
String
representing this instruction subtree
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |