APIdia Launch Partner
Top Description Methods
java.lang.classfile.attribute

public sealed Interface LineNumberInfo

permits UnboundLineNumberInfo
Known Direct Implementers
jdk.internal.classfile.impl.UnboundAttribute.UnboundLineNumberInfo
Imports
java.lang.classfile.CodeBuilder, java.lang.classfile.instruction.LineNumber, jdk.internal.classfile.impl.UnboundAttribute

Models a single line number entry in the LineNumberTableAttribute.
Since
24
See Also
LineNumberTableAttribute#lineNumbers(), LineNumber

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the line number within the original source file
lineNumber
()

Returns the line number within the original source file.

public static LineNumberInfo

Returns:

a line number description
of
(int
the starting index of the code array for this line
startPc
,
int
the line number within the original source file
lineNumber
)

Returns a line number description.

public int

Returns:

the index into the code array at which the code for this line begins
startPc
()

Returns the index into the code array at which the code for this line begins.

Method Detail

lineNumberback to summary
public int lineNumber()

Returns the line number within the original source file.

Returns:int

the line number within the original source file

ofback to summary
public static LineNumberInfo of(int startPc, int lineNumber)

Returns a line number description.

API Note

The created entry cannot be written to a CodeBuilder. Call CodeBuilder::lineNumber in the correct order instead.

Parameters
startPc:int

the starting index of the code array for this line

lineNumber:int

the line number within the original source file

Returns:LineNumberInfo

a line number description

Exceptions
IllegalArgumentException:
if startPc or lineNumber is not u2
startPcback to summary
public int startPc()

Returns the index into the code array at which the code for this line begins.

Returns:int

the index into the code array at which the code for this line begins