Package org.apache.tapestry5.plastic
Interface SwitchBlock
- All Known Implementing Classes:
SwitchBlockImpl
public interface SwitchBlock
Support for building the equivalent of a Java switch statement.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddCase(int caseValue, boolean jumpToEnd, InstructionBuilderCallback callback) Adds a handler for a particular case value.voidaddDefault(InstructionBuilderCallback callback) Adds the default handler.
-
Method Details
-
addCase
Adds a handler for a particular case value. This method should only be invoked at most once for each case value.- Parameters:
caseValue- value to matchjumpToEnd- true if a jump to the end should be provided, or false if either the callback generated a return opcode, or it is desired to "drop down" into the next case handler. The last case handled drop down out of the SwitchBlock.callback- provides the logic for the specified case
-
addDefault
Adds the default handler. This is optional, and is only allowed after all cases have been added. The default handler automatically throws anIllegalArgumentException.- Parameters:
callback- provides the logic for the default handler case.
-