freemarker.template.instruction
Class CaseInstruction
java.lang.Object
freemarker.template.instruction.DefaultCaseInstruction
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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
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