Class LineNumberTableWriter


  • public final class LineNumberTableWriter
    extends ClassWriter.Element
    This class helps emit LineNumberTable attributes.
    • Method Detail

      • setRawTable

        public void setRawTable​(int[] table)
        Set the raw table entries. Consider calling LineNumberTableWriter.makeRawTable to build the raw entries.
        Parameters:
        table - a flattened sequence of (startPC, lineNumber) pairs
      • getSize

        public int getSize()
        Specified by:
        getSize in class ClassWriter.Element
        Returns:
        the number of bytes that will be generated.
      • makeRawTable

        public static int[] makeRawTable​(int[] newLineMap)
                                  throws IllegalArgumentException
        Parameters:
        newLineMap - an array indexed by bytecode offset, mapping each bytecode offset to its line number (or 0 if there is no line or it's not known)
        Returns:
        the line numbers in "raw" format, a flattened sequence of (startPC, lineNumber) pairs
        Throws:
        IllegalArgumentException - if newLineMap == null