Interface Label


public interface Label
Represents a label bound to a method body.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Generates an unconditional goto statement to this label, which doesn't need to be positioned yet.
    Sets the position of the label at the location of the next code instruction.
    Insert a body of code immediately after this positioned label, and return a new label which is positioned after the end of the inserted code body.
    Returns the MethodMaker that this label belongs to.
  • Method Details

    • here

      Label here()
      Sets the position of the label at the location of the next code instruction.
      Returns:
      this label
      Throws:
      IllegalStateException - if this label is already positioned
    • goto_

      Label goto_()
      Generates an unconditional goto statement to this label, which doesn't need to be positioned yet.
      Returns:
      this label
      See Also:
    • insert

      Label insert(Runnable body)
      Insert a body of code immediately after this positioned label, and return a new label which is positioned after the end of the inserted code body.

      If the label is positioned within a block of code which has already been guarded by a finally handler, the inserted code won't be fully guarded. If it branches out of the guarded range or if it returns from the method, the handler won't run. If the code throws an exception, the handler will still run.

      Parameters:
      body - called to generate the body of the inserted code
      Returns:
      a label positioned at the end of the inserted code body
      Throws:
      IllegalStateException - if this label is unpositioned
    • methodMaker

      MethodMaker methodMaker()
      Returns the MethodMaker that this label belongs to.