freemarker.template.instruction
Class CaseInstruction

java.lang.Object
  extended by freemarker.template.instruction.DefaultCaseInstruction
      extended by freemarker.template.instruction.CaseInstruction
All Implemented Interfaces:
Instruction, TemplateProcessor, java.io.Serializable

public final class CaseInstruction
extends DefaultCaseInstruction
implements java.io.Serializable

Represents a case in a switch statement. Unexpectedly, this is subclassed from the DefaultCaseInstruction class.

Version:
$Id: CaseInstruction.java 1153 2013-04-15 10:59:37Z run2000 $
See Also:
DefaultCaseInstruction, SwitchInstruction, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface freemarker.template.TemplateProcessor
TemplateProcessor.ExitStatus
 
Nested classes/interfaces inherited from interface freemarker.template.instruction.Instruction
Instruction.EndType
 
Field Summary
 
Fields inherited from class freemarker.template.instruction.DefaultCaseInstruction
body
 
Constructor Summary
CaseInstruction(Expression expression)
          Constructor that takes an Expression to be evaluated when the case instruction is encountered.
 
Method Summary
 Instruction.EndType getEndType()
          Retrieve the type of end instruction, if any.
 Expression getExpression()
          Retrieves the Expression to be evaluated when the case instruction is encountered.
 boolean isDefault()
          Is this the default case?
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class freemarker.template.instruction.DefaultCaseInstruction
callBuilder, isEndInstruction, process, setBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CaseInstruction

public CaseInstruction(Expression expression)
Constructor that takes an Expression to be evaluated when the case instruction is encountered.

Parameters:
expression - the Expression associated with this Case.
Throws:
java.lang.NullPointerException - the expression was null
java.lang.IllegalArgumentException - the expression was not a string or number
Method Detail

getExpression

public Expression getExpression()
Retrieves the Expression to be evaluated when the case instruction is encountered.

Overrides:
getExpression in class DefaultCaseInstruction
Returns:
the Expression associated with this CaseInstruction

isDefault

public boolean isDefault()
Is this the default case?

Overrides:
isDefault in class DefaultCaseInstruction
Returns:
true if this is the default case, otherwise false

getEndType

public Instruction.EndType getEndType()
Retrieve the type of end instruction, if any.

Specified by:
getEndType in interface Instruction
Overrides:
getEndType in class DefaultCaseInstruction
Returns:
CASE

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class DefaultCaseInstruction
Returns:
a String representing this instruction subtree