Package Summary Overview Summary

Module java.base
Package java.lang.classfilePREVIEW

# 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

- ## Nested Class Summary

  ## Nested classes/interfaces declared in interface java.lang.classfile.CodeBuilderPREVIEW

  `CodeBuilder.BlockCodeBuilderPREVIEW, CodeBuilder.CatchBuilderPREVIEW`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `LabelPREVIEW`
  `breakLabel()`
  Returns the label locating where control is passed back to the parent block..

  ### Methods declared in interface java.lang.classfile.ClassFileBuilderPREVIEW

  `accept, canWriteDirect, constantPool, transform, with`

  ### Methods declared in interface java.lang.classfile.CodeBuilderPREVIEW

  `aaload, aastore, aconst_null, allocateLocal, aload, anewarray, anewarray, areturn, arraylength, arrayLoadInstruction, arrayStoreInstruction, astore, athrow, baload, bastore, bipush, block, branchInstruction, caload, castore, characterRange, checkcast, checkcast, constantInstruction, constantInstruction, convertInstruction, d2f, d2i, d2l, dadd, daload, dastore, dcmpg, dcmpl, dconst_0, dconst_1, ddiv, dload, dmul, dneg, drem, dreturn, dstore, dsub, dup, dup_x1, dup_x2, dup2, dup2_x1, dup2_x2, endLabel, exceptionCatch, exceptionCatch, exceptionCatch, exceptionCatchAll, f2d, f2i, f2l, fadd, faload, fastore, fcmpg, fcmpl, fconst_0, fconst_1, fconst_2, fdiv, fieldInstruction, fieldInstruction, fload, fmul, fneg, frem, freturn, fstore, fsub, getfield, getfield, getstatic, getstatic, goto_, goto_w, i2b, i2c, i2d, i2f, i2l, i2s, iadd, iaload, iand, iastore, iconst_0, iconst_1, iconst_2, iconst_3, iconst_4, iconst_5, iconst_m1, idiv, if_acmpeq, if_acmpne, if_icmpeq, if_icmpge, if_icmpgt, if_icmple, if_icmplt, if_icmpne, if_nonnull, if_null, ifeq, ifge, ifgt, ifle, iflt, ifne, ifThen, ifThen, ifThenElse, ifThenElse, iinc, iload, imul, incrementInstruction, ineg, instanceof_, instanceof_, invokedynamic, invokedynamic, invokeDynamicInstruction, invokeDynamicInstruction, invokeInstruction, invokeInstruction, invokeinterface, invokeinterface, invokespecial, invokespecial, invokespecial, invokespecial, invokestatic, invokestatic, invokestatic, invokestatic, invokevirtual, invokevirtual, ior, irem, ireturn, ishl, ishr, istore, isub, iushr, ixor, l2d, l2f, l2i, labelBinding, ladd, laload, land, lastore, lcmp, lconst_0, lconst_1, ldc, ldc, ldiv, lineNumber, lload, lmul, lneg, loadInstruction, localVariable, localVariable, localVariableType, localVariableType, lookupswitch, lookupSwitchInstruction, lor, lrem, lreturn, lshl, lshr, lstore, lsub, lushr, lxor, monitorenter, monitorexit, monitorInstruction, multianewarray, multianewarray, new_, new_, newarray, newBoundLabel, newLabel, newMultidimensionalArrayInstruction, newMultidimensionalArrayInstruction, newObjectInstruction, newObjectInstruction, newPrimitiveArrayInstruction, newReferenceArrayInstruction, newReferenceArrayInstruction, nop, nopInstruction, operatorInstruction, original, parameterSlot, pop, pop2, putfield, putfield, putstatic, putstatic, receiverSlot, return_, returnInstruction, saload, sastore, sipush, stackInstruction, startLabel, storeInstruction, swap, tableswitch, tableswitch, tableSwitchInstruction, throwInstruction, transforming, trying, typeCheckInstruction, typeCheckInstruction`

  ### Methods declared in interface java.util.function.Consumer

  `andThen`

- ## 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.