Package com.google.inject.internal.util
Class LineNumbers
- java.lang.Object
-
- com.google.inject.internal.util.LineNumbers
-
final class LineNumbers extends java.lang.ObjectLooks up line numbers for classes and their members.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classLineNumbers.LineNumberReader
-
Field Summary
Fields Modifier and Type Field Description private static intASM_API_LEVELprivate intfirstLineprivate java.util.Map<java.lang.String,java.lang.Integer>linesprivate java.lang.Stringsourceprivate java.lang.Classtype
-
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 intgetFirstLine()Gets the first line number.java.lang.IntegergetLineNumber(java.lang.reflect.Member member)Get the line number associated with the given member.java.lang.StringgetSource()Get the source file name as read from the bytecode.private java.lang.StringmemberKey(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)
-
-