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
LocalVariableTableAttribute
PREVIEW. Delivered as a CodeElement
PREVIEW
during traversal of the elements of a CodeModel
PREVIEW, according to
the setting of the ClassFile.DebugElementsOption
PREVIEW 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 LocalVariablePREVIEW
of
(int slot, Utf8EntryPREVIEW nameEntry, Utf8EntryPREVIEW descriptorEntry, LabelPREVIEW startScope, LabelPREVIEW endScope) Returns a local variable pseudo-instruction.static LocalVariablePREVIEW
Returns a local variable pseudo-instruction.int
slot()
Returns the local variable slot.Returns the start range of the local variable scope.type()
Returns the local variable field descriptor.default ClassDesc
Returns the local variable type, as a symbolic descriptor.boolean
Writes the local variable to the specified writer
-
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
-
writeTo
-
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
-
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
-
LocalVariable
when preview features are enabled.