com.google.inject.internal
Class LineNumbers

java.lang.Object
  extended by com.google.inject.internal.LineNumbers

public class LineNumbers
extends java.lang.Object

Looks up line numbers for classes and their members.

Author:
Chris Nokleberg

Constructor Summary
LineNumbers(java.lang.Class type)
          Reads line number information from the given class, if available.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineNumbers

public LineNumbers(java.lang.Class type)
            throws java.io.IOException
Reads line number information from the given class, if available.

Parameters:
type - the class to read line number information from
Throws:
java.lang.IllegalArgumentException - if the bytecode for the class cannot be found
java.io.IOException - if an error occurs while reading bytecode
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.



Copyright © 2011. All Rights Reserved.