final class LineNumbers
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private class |
LineNumbers.LineNumberReader |
Modifier and Type | Field and Description |
---|---|
private int |
firstLine |
private java.util.Map<java.lang.String,java.lang.Integer> |
lines |
private java.lang.String |
source |
private java.lang.Class |
type |
Constructor and Description |
---|
LineNumbers(java.lang.Class type)
Reads line number information from the given class, if available.
|
Modifier and Type | Method and Description |
---|---|
int |
getFirstLine()
Gets the first line number.
|
java.lang.Integer |
getLineNumber(java.lang.reflect.Member member)
Get the line number associated with the given member.
|
java.lang.String |
getSource()
Get the source file name as read from the bytecode.
|
private java.lang.String |
memberKey(java.lang.reflect.Member member) |
private final java.lang.Class type
private final java.util.Map<java.lang.String,java.lang.Integer> lines
private java.lang.String source
private int firstLine
public LineNumbers(java.lang.Class type) throws java.io.IOException
type
- the class to read line number information fromjava.lang.IllegalArgumentException
- if the bytecode for the class cannot be foundjava.io.IOException
- if an error occurs while reading bytecodepublic java.lang.String getSource()
public java.lang.Integer getLineNumber(java.lang.reflect.Member member)
member
- a field, constructor, or method belonging to the class used during constructionjava.lang.IllegalArgumentException
- if the member does not belong to the class used during
constructionpublic int getFirstLine()
private java.lang.String memberKey(java.lang.reflect.Member member)