Class LineNumbers$


  • public class LineNumbers$
    extends java.lang.Object
    This is a minimized byte-code parser that concentrates exclusively on line numbers and source file extraction. It works for all normal classes up to format 52:0 (JDK8), and it also works for Lambdas that are Serializable. The latter restriction is due to the fact that the proxy object generated by LambdaMetafactory otherwise contains no information about which method backs this particular lambda (and there might be multiple defined within a single class).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static LineNumbers$ MODULE$
      Static reference to the singleton instance of this Scala object.
    • Constructor Summary

      Constructors 
      Constructor Description
      LineNumbers$()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      LineNumbers.Result apply​(java.lang.Object obj)
      Scala API: Obtain line number information for the class defining the given object.
      java.lang.String prettyName​(java.lang.Object obj)
      Extract source information if available and format a string to identify the class definition in question.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MODULE$

        public static final LineNumbers$ MODULE$
        Static reference to the singleton instance of this Scala object.
    • Constructor Detail

      • LineNumbers$

        public LineNumbers$()
    • Method Detail

      • apply

        public LineNumbers.Result apply​(java.lang.Object obj)
        Scala API: Obtain line number information for the class defining the given object. This is done by reading the byte code (a potentially blocking IO operation) and interpreting the debug information that it may contain.

        This does not work for Java 8 lambdas that are not Serializable, because the language designers have consciously made it impossible to obtain the byte code for those.

      • prettyName

        public java.lang.String prettyName​(java.lang.Object obj)
        Extract source information if available and format a string to identify the class definition in question. This will include the package name and either source file information or the class name.