Interface LocalVariable
- All Superinterfaces:
- ClassFileElement,- CodeElement,- PseudoInstruction
A pseudo-instruction which models a single entry in the 
 Where 
LocalVariableTable attribute.  Delivered as a
 CodeElement during traversal of the elements of a CodeModel,
 according to the setting of the ClassFile.DebugElementsOption option.
 A local variable entry is composite:
LocalVariable(
    int slot,
    String name,
    ClassDesc type,
    Label startScope,
    Label endScope
)
slot is within [0, 65535].
 
 Another model, LocalVariableInfo, also models a local variable
 entry; it has no dependency on a CodeModel and represents of bci
 values as ints instead of Labels, and is used as components
 of a LocalVariableTableAttribute.
- API Note:
- LocalVariableis used for all local variables in Java source code. If a local variable has a parameterized type, a type argument, or an array type of one of the previous types, a- LocalVariableTypeshould be created for that local variable as well.
- Since:
- 24
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionendScope()Returns the end range of the local variable scope.name()Returns the local variable name.static LocalVariableReturns a local variable pseudo-instruction.static LocalVariableReturns a local variable pseudo-instruction.intslot()Returns the local variable slot.Returns the start range of the local variable scope.type()Returns the local variable field descriptor string.default ClassDescReturns the local variable type, as a symbolic descriptor.
- 
Method Details- 
slotint slot()Returns the local variable slot. The value is within[0, 65535].- Returns:
- the local variable slot
 
- 
name
- 
typeUtf8Entry type()Returns the local variable field descriptor string.- API Note:
- A symbolic descriptor for the type of the local variable is available
 through typeSymbol().
- Returns:
- the local variable field descriptor string
 
- 
typeSymbolReturns the local variable type, as a symbolic descriptor.- Returns:
- the local variable type, as a symbolic descriptor
 
- 
startScopeLabel startScope()Returns the start range of the local variable scope.- Returns:
- the start range of the local variable scope
 
- 
endScopeLabel endScope()Returns the end range of the local variable scope.- Returns:
- the end range of the local variable scope
 
- 
ofstatic LocalVariable of(int slot, Utf8Entry nameEntry, Utf8Entry descriptorEntry, Label startScope, Label endScope) Returns a local variable pseudo-instruction.slotmust be within[0, 65535].- 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
- Throws:
- IllegalArgumentException- if- slotis out of range
 
- 
ofstatic LocalVariable of(int slot, String name, ClassDesc descriptor, Label startScope, Label endScope) Returns a local variable pseudo-instruction.slotmust be within[0, 65535].- 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
- Throws:
- IllegalArgumentException- if- slotis out of range
 
 
-