Interface LocalVariable

All Superinterfaces:
ClassfileElement, CodeElement, PseudoInstruction
All Known Implementing Classes:
AbstractPseudoInstruction.UnboundLocalVariable, BoundLocalVariable

public sealed interface LocalVariable extends PseudoInstruction permits AbstractPseudoInstruction.UnboundLocalVariable, BoundLocalVariable
A pseudo-instruction which models a single entry in the LocalVariableTableAttribute. Delivered as a CodeElement during traversal of the elements of a CodeModel, according to the setting of the Classfile.Option.processDebug(boolean) option.
See Also:
  • Method Details

    • slot

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

      Utf8Entry name()
      Returns the local variable name.
      Returns:
      the local variable name
    • type

      Utf8Entry type()
      Returns the local variable field descriptor.
      Returns:
      the local variable field descriptor
    • typeSymbol

      default ClassDesc typeSymbol()
      Returns the local variable type, as a symbolic descriptor.
      Returns:
      the local variable type, as a symbolic descriptor
    • startScope

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

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

      boolean writeTo(BufWriter buf)
    • of

      static LocalVariable of(int slot, Utf8Entry nameEntry, Utf8Entry descriptorEntry, Label startScope, Label endScope)
      Returns a local variable pseudo-instruction.
      Parameters:
      slot - the local variable slot
      nameEntry - the local variable name
      descriptorEntry - the local variable descriptor
      startScope - the start range of the local variable scope
      endScope - the end range of the local variable scope
      Returns:
      a local variable pseudo-instruction
    • of

      static LocalVariable of(int slot, String name, ClassDesc descriptor, Label startScope, Label endScope)
      Returns a local variable pseudo-instruction.
      Parameters:
      slot - the local variable slot
      name - the local variable name
      descriptor - the local variable descriptor
      startScope - the start range of the local variable scope
      endScope - the end range of the local variable scope
      Returns:
      a local variable pseudo-instruction