Class LocalVariableTable

java.lang.Object
de.inetsoftware.classparser.LocalVariableTable

public class LocalVariableTable extends Object
  • Field Details

    • maxLocals

      private final int maxLocals
    • table

      private LocalVariable[] table
  • Constructor Details

    • LocalVariableTable

      LocalVariableTable(int maxLocals, ConstantPool constantPool, DataInputStream input) throws IOException
      Create a new instance of the code attribute "LocalVariableTable". http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.13 http://docs.oracle.com/javase/specs/jvms/se5.0/html/ClassFile.doc.html#5956
      Parameters:
      maxLocals - the count of local variables in the memory
      constantPool - Reference to the current ConstantPool
      input - the stream of the class
      Throws:
      IOException - if any I/O error occurs.
    • LocalVariableTable

      LocalVariableTable(int maxLocals)
      Create an instance without any debug details.
      Parameters:
      maxLocals - the count of local variables in the memory
  • Method Details

    • getMaxLocals

      public int getMaxLocals()
      Get the count of variables/slots. This is not the count of declared LocalVariable in this table. There can be unnamed helper variables for the compiler which are not in the table. There can be reused slots for different variables.
      Returns:
      the count
    • getTable

      public LocalVariable[] getTable()
      Get the declared local variables
      Returns:
      the variables