Interface LocalVariableType

All Superinterfaces:
ClassFileElementPREVIEW, CodeElementPREVIEW, PseudoInstructionPREVIEW

public sealed interface LocalVariableType extends PseudoInstructionPREVIEW
LocalVariableType is a preview API of the Java platform.
Programs can only use LocalVariableType when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
A pseudo-instruction which models a single entry in the LocalVariableTypeTableAttributePREVIEW. Delivered as a CodeElementPREVIEW during traversal of the elements of a CodeModelPREVIEW, according to the setting of the ClassFile.DebugElementsOptionPREVIEW option.
Since:
22
  • Method Details

    • slot

      int slot()
      Returns the local variable slot.
      Returns:
      the local variable slot
    • name

      Returns the local variable name.
      Returns:
      the local variable name
    • signature

      Utf8EntryPREVIEW signature()
      Returns the local variable signature.
      Returns:
      the local variable signature
    • signatureSymbol

      default SignaturePREVIEW signatureSymbol()
      Returns the local variable signature.
      Returns:
      the local variable signature
    • startScope

      LabelPREVIEW startScope()
      Returns the start range of the local variable scope.
      Returns:
      the start range of the local variable scope
    • endScope

      LabelPREVIEW endScope()
      Returns the end range of the local variable scope.
      Returns:
      the end range of the local variable scope
    • writeTo

      boolean writeTo(BufWriterPREVIEW buf)
      Writes the local variable to the specified writer
      Parameters:
      buf - the writer
      Returns:
      true if the variable has been written
    • of

      static LocalVariableTypePREVIEW of(int slot, Utf8EntryPREVIEW nameEntry, Utf8EntryPREVIEW signatureEntry, LabelPREVIEW startScope, LabelPREVIEW endScope)
      Returns a local variable type pseudo-instruction.
      Parameters:
      slot - the local variable slot
      nameEntry - the local variable name
      signatureEntry - the local variable signature
      startScope - the start range of the local variable scope
      endScope - the end range of the local variable scope
      Returns:
      a local variable type pseudo-instruction
    • of

      static LocalVariableTypePREVIEW of(int slot, String name, SignaturePREVIEW signature, LabelPREVIEW startScope, LabelPREVIEW endScope)
      Returns a local variable type pseudo-instruction.
      Parameters:
      slot - the local variable slot
      name - the local variable name
      signature - the local variable signature
      startScope - the start range of the local variable scope
      endScope - the end range of the local variable scope
      Returns:
      a local variable type pseudo-instruction