org.objectweb.asm.attrs

Class LocalVariableTypeTableAttribute

Known Direct Subclasses:
ASMLocalVariableTypeTableAttribute

public class LocalVariableTypeTableAttribute
extends Attribute

The LocalVariableTypeTable attribute is an optional variable-length attribute of a Code attribute. It may be used by debuggers to determine the value of a given local variable during the execution of a method. If LocalVariableTypeTable attributes are present in the attributes table of a given Code attribute, then they may appear in any order. There may be no more than one LocalVariableTypeTable attribute per local variable in the Code attribute. The LocalVariableTypeTable attribute differs from the LocalVariableTable attribute in that it provides signature information rather than descriptor information. This difference is only significant for variables whose type is a generic reference type. Such variables will appear in both tables, while variables of other types will appear only in LocalVariableTable.

The LocalVariableTypeTable attribute has the following format:

   LocalVariableTypeTable_attribute {
     u2 attribute_name_index;
     u4 attribute_length;
     u2 local_variable_type_table_length;
     { 
       u2 start_pc;
       u2 length;
       u2 name_index;
       u2 signature_index;
       u2 index;
     } local_variable_type_table[local_variable_type_table_length];
   }
 
The items of the LocalVariableTypeTable_attribute structure are as follows:

The value of the signature_index item must be a valid index into the constant_pool table. The constant_pool entry at that index must contain a CONSTANT_Utf8_info structure representing a field type signature encoding the type of a local variable in the source program.

Author:
Eugene Kuleshov

Field Summary

protected List
types

Fields inherited from class org.objectweb.asm.Attribute

next, type

Constructor Summary

LocalVariableTypeTableAttribute()

Method Summary

protected Label[]
getLabels()
List
getTypes()
protected Attribute
read(ClassReader cr, int off, int len, char[] buf, int codeOff, Label[] labels)
String
toString()
protected ByteVector
write(ClassWriter cw, byte[] code, int len, int maxStack, int maxLocals)

Methods inherited from class org.objectweb.asm.Attribute

getLabels, isUnknown, read, write

Field Details

types

protected List types

Constructor Details

LocalVariableTypeTableAttribute

public LocalVariableTypeTableAttribute()

Method Details

getLabels

protected Label[] getLabels()
Overrides:
getLabels in interface Attribute

getTypes

public List getTypes()

read

protected Attribute read(ClassReader cr,
                         int off,
                         int len,
                         char[] buf,
                         int codeOff,
                         Label[] labels)
Overrides:
read in interface Attribute

toString

public String toString()

write

protected ByteVector write(ClassWriter cw,
                           byte[] code,
                           int len,
                           int maxStack,
                           int maxLocals)
Overrides:
write in interface Attribute