Interface CodeBuilder.BlockCodeBuilder

All Superinterfaces:
ClassFileBuilderPREVIEW<CodeElementPREVIEW,CodeBuilderPREVIEW>, CodeBuilderPREVIEW, Consumer<CodeElementPREVIEW>
Enclosing interface:
CodeBuilderPREVIEW

public static sealed interface CodeBuilder.BlockCodeBuilder extends CodeBuilderPREVIEW
BlockCodeBuilder is a preview API of the Java platform.
Programs can only use BlockCodeBuilder when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
A builder for blocks of code.
Since:
22
  • Method Details

    • breakLabel

      LabelPREVIEW 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 an instruction occurring immediately after the built block's last instruction would be reachable from that last instruction, then a gotoPREVIEW instruction targeting the "break" label is appended to the built block.

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