jellyj.classfile.javaclass
Class LocalVariableTable

jellyj.classfile.javaclass.Attribute
  |
  +--jellyj.classfile.javaclass.LocalVariableTable

public class LocalVariableTable
extends Attribute

This class is derived from Attribute and represents colection of local variables in a method. This attribute is used by the Code attribute.

Author:
JellyJ Design Group
See Also: Code, LocalVariable

Constructor Summary
 LocalVariableTable()
          Empty constructor, all attributes have to be defined via `setXXX' methods.
 LocalVariableTable(LocalVariableTable c)
          Initialize from another object.
 LocalVariableTable(int name_index, int length, LocalVariable[] local_variable_table, ConstantPool constant_pool)
           
 (package private) LocalVariableTable(int name_index, int length, DataInputStream file, ConstantPool constant_pool)
          Construct object from file stream.

Method Summary
 voidaccept(Visitor v)
          Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.
 final voiddump(DataOutputStream file)
          Dump local variable table attribute to file stream in binary format.
 final ConstantPoolgetConstantPool()
           
 final LocalVariable[]getLocalVariableTable()
           
 final voidsetConstantPool(ConstantPool constant_pool)
           
 final voidsetLocalVariableTable(LocalVariable[] local_variable_table)
           
 final StringtoString()
           

Methods inherited from class jellyj.classfile.javaclass.Attribute
getLength, getNameIndex, getTag, readAttribute, setLength, setNameIndex

Constructor Detail

LocalVariableTable

public LocalVariableTable()
Empty constructor, all attributes have to be defined via `setXXX' methods. Use at your own risk.

LocalVariableTable

public LocalVariableTable(LocalVariableTable c)
Initialize from another object. Note that both objects use the same references (shallow copy). Use clone() for a physical copy.

LocalVariableTable

public LocalVariableTable(int name_index, int length, LocalVariable[] local_variable_table, ConstantPool constant_pool)
Parameters:
name_index - Index in constant pool to `LocalVariableTable'
length - Content length in bytes
local_variable_table - Table of local variables
constant_pool - Array of constants

LocalVariableTable

LocalVariableTable(int name_index, int length, DataInputStream file, ConstantPool constant_pool)
throws java.io.IOException
Construct object from file stream.
Parameters:
name_index - Index in constant pool
length - Content length in bytes
file - Input stream
constant_pool - Array of constants
throw IOException
Method Detail

accept

public void accept(Visitor v)
Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.
Parameters:
v - Visitor object

dump

public final void dump(DataOutputStream file)
throws java.io.IOException
Dump local variable table attribute to file stream in binary format.
Parameters:
file - Output file stream
throw IOException

getConstantPool

public final ConstantPool getConstantPool()
Returns: Constant pool used by this object.
See Also:
ConstantPool

getLocalVariableTable

public final LocalVariable[] getLocalVariableTable()
Returns: Array of local variables of method.

setConstantPool

public final void setConstantPool(ConstantPool constant_pool)
Parameters:
constant_pool - Constant pool to be used for this object.
See Also:
ConstantPool

setLocalVariableTable

public final void setLocalVariableTable(LocalVariable[] local_variable_table)

toString

public final String toString()
Returns: String representation.

Association Links

to Class jellyj.classfile.javaclass.LocalVariable

to Class jellyj.classfile.javaclass.ConstantPool