Package com.google.inject.internal.util
Class LineNumbers
- java.lang.Object
-
- com.google.inject.internal.util.LineNumbers
-
final class LineNumbers extends java.lang.Object
Looks up line numbers for classes and their members.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
LineNumbers.LineNumberReader
-
Field Summary
Fields Modifier and Type Field Description private static int
ASM_API_LEVEL
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 Summary
Constructors Constructor Description LineNumbers(java.lang.Class type)
Reads line number information from the given class, if available.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
-
-
Field Detail
-
ASM_API_LEVEL
private static final int ASM_API_LEVEL
- See Also:
- Constant Field Values
-
type
private final java.lang.Class type
-
lines
private final java.util.Map<java.lang.String,java.lang.Integer> lines
-
source
private java.lang.String source
-
firstLine
private int firstLine
-
-
Method Detail
-
getSource
public java.lang.String getSource()
Get the source file name as read from the bytecode.- Returns:
- the source file name if available, or null
-
getLineNumber
public java.lang.Integer getLineNumber(java.lang.reflect.Member member)
Get the line number associated with the given member.- Parameters:
member
- a field, constructor, or method belonging to the class used during construction- Returns:
- the wrapped line number, or null if not available
- Throws:
java.lang.IllegalArgumentException
- if the member does not belong to the class used during construction
-
getFirstLine
public int getFirstLine()
Gets the first line number.
-
memberKey
private java.lang.String memberKey(java.lang.reflect.Member member)
-
-