Interface LocalVariable
- All Superinterfaces:
ClassFileElementPREVIEW,CodeElementPREVIEW,PseudoInstructionPREVIEW
LocalVariable is a preview API of the Java platform.
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
LocalVariableTableAttributePREVIEW. Delivered as a CodeElementPREVIEW
during traversal of the elements of a CodeModelPREVIEW, according to
the setting of the ClassFile.DebugElementsOptionPREVIEW option.- Since:
- 22
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionendScope()Returns the end range of the local variable scope.name()Returns the local variable name.static LocalVariablePREVIEWof(int slot, Utf8EntryPREVIEW nameEntry, Utf8EntryPREVIEW descriptorEntry, LabelPREVIEW startScope, LabelPREVIEW endScope) Returns a local variable pseudo-instruction.static LocalVariablePREVIEWReturns 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.default ClassDescReturns the local variable type, as a symbolic descriptor.
-
Method Details
-
slot
int slot()Returns the local variable slot.- Returns:
- the local variable slot
-
name
-
type
-
typeSymbol
Returns the local variable type, as a symbolic descriptor.- Returns:
- the local variable type, as a symbolic descriptor
-
startScope
-
endScope
-
of
static LocalVariablePREVIEW of(int slot, Utf8EntryPREVIEW nameEntry, Utf8EntryPREVIEW descriptorEntry, LabelPREVIEW startScope, LabelPREVIEW endScope) Returns a local variable pseudo-instruction.- Parameters:
slot- the local variable slotnameEntry- the local variable namedescriptorEntry- the local variable descriptorstartScope- the start range of the local variable scopeendScope- the end range of the local variable scope- Returns:
- a local variable pseudo-instruction
- Throws:
IllegalArgumentException- ifslotis out of range
-
of
static LocalVariablePREVIEW of(int slot, String name, ClassDesc descriptor, LabelPREVIEW startScope, LabelPREVIEW endScope) Returns a local variable pseudo-instruction.- Parameters:
slot- the local variable slotname- the local variable namedescriptor- the local variable descriptorstartScope- the start range of the local variable scopeendScope- the end range of the local variable scope- Returns:
- a local variable pseudo-instruction
- Throws:
IllegalArgumentException- ifslotis out of range
-
LocalVariablewhen preview features are enabled.