Class LocalVariableTable
java.lang.Object
org.aspectj.apache.bcel.classfile.Attribute
org.aspectj.apache.bcel.classfile.LocalVariableTable
- All Implemented Interfaces:
Serializable
,Cloneable
,Node
This class represents collection of local variables in a method. This attribute is contained in the Code attribute.
- Version:
- $Id: LocalVariableTable.java,v 1.8 2009/09/15 19:40:12 aclement Exp $
- Author:
- M. Dahm
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionLocalVariableTable
(int name_index, int length, LocalVariable[] local_variable_table, ConstantPool constant_pool) Initialize from another object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.Returns copy of this attribute using same packed state.final void
dump
(DataOutputStream file) Dump local variable table attribute to file stream in binary format.final LocalVariable
getLocalVariable
(int index) final LocalVariable[]
final int
final void
setLocalVariableTable
(LocalVariable[] local_variable_table) final String
toString()
Methods inherited from class org.aspectj.apache.bcel.classfile.Attribute
getConstantPool, getLength, getName, getNameIndex, getTag, readAttribute
-
Constructor Details
-
LocalVariableTable
Initialize from another object. Note that both objects use the same references (shallow copy). Use copy() 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 byteslocal_variable_table
- Table of local variablesconstant_pool
- Array of constants
-
-
Method Details
-
accept
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. -
dump
Dump local variable table attribute to file stream in binary format.- Overrides:
dump
in classAttribute
- Parameters:
file
- Output file stream- Throws:
IOException
-
getLocalVariableTable
- Returns:
- Array of local variables of method.
-
getLocalVariable
- Returns:
- first matching variable using index
-
setLocalVariableTable
-
toString
-
copyFromPackedState
Returns copy of this attribute using same packed state. Used in unit tests. -
getTableLength
public final int getTableLength()- Returns:
- deep copy of this attribute
-