Class LocalVariableTableReader


  • public final class LocalVariableTableReader
    extends AttributeReader
    This class reads LocalVariableTable attributes.

    Instead of constructing a LocalVariableTable directly, consider just calling LocalVariableTable.makeVarMap for convenient access to aggregate local variable data from all the LocalVariableTable attributes for a given Code.

    • Method Detail

      • getRawTable

        public int[] getRawTable()
        Returns:
        the raw line number table data, a flattened sequence of (startPC, PClength, nameIndex, typeIndex, var) tuples
      • makeVarMap

        public static int[][] makeVarMap​(CodeReader code)
                                  throws InvalidClassFileException,
                                         java.lang.IllegalArgumentException
        Returns:
        an array mapping bytecode offsets to arrays representing the local variable maps for each offset; a local variable map is represented as an array of localVars*2 elements, containing a pair (nameIndex, typeIndex) for each local variable; a pair (0,0) indicates there is no information for that local variable at that offset
        Throws:
        InvalidClassFileException
        java.lang.IllegalArgumentException