Interface CodeBuilder.BlockCodeBuilder

All Superinterfaces:
ClassFileBuilder<CodeElement, CodeBuilder>, CodeBuilder, Consumer<CodeElement>
Enclosing interface:
CodeBuilder

public static sealed interface CodeBuilder.BlockCodeBuilder extends CodeBuilder
A builder for blocks of code. Its CodeBuilder.startLabel() and CodeBuilder.endLabel() do not enclose the entire method body, but from the start to the end of the block.
Since:
24
  • Method Details

    • breakLabel

      Label breakLabel()
      Returns the label locating where control is passed back to the parent block. A branch to this label "break"'s out of the current block.

      If the last instruction in this block does not lead to the break label, Class-File API may append instructions to target the "break" label to the built block.

      Returns:
      the label locating where control is passed back to the parent block