Class LineNumbers

java.lang.Object
com.google.inject.internal.util.LineNumbers

final class LineNumbers extends Object
Looks up line numbers for classes and their members.
  • Field Details

  • Constructor Details

    • LineNumbers

      public LineNumbers(Class<?> type) throws IOException
      Reads line number information from the given class, if available.
      Parameters:
      type - the class to read line number information from
      Throws:
      IOException
  • Method Details

    • getSource

      public String getSource()
      Get the source file name as read from the bytecode.
      Returns:
      the source file name if available, or null
    • getLineNumber

      public Integer getLineNumber(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:
      IllegalArgumentException - if the member does not belong to the class used during construction
    • getFirstLine

      public int getFirstLine()
      Gets the first line number.
    • memberKey

      private String memberKey(Member member)