Package org.apache.bcel.classfile
Class LocalVariableTypeTable
- java.lang.Object
-
- org.apache.bcel.classfile.Attribute
-
- org.apache.bcel.classfile.LocalVariableTypeTable
-
- All Implemented Interfaces:
java.lang.Cloneable,java.lang.Iterable<LocalVariable>,Node
public class LocalVariableTypeTable extends Attribute implements java.lang.Iterable<LocalVariable>
Represents the LocalVariableTypeTable attribute.- Since:
- 6.0
-
-
Field Summary
-
Fields inherited from class org.apache.bcel.classfile.Attribute
constant_pool, length, name_index, tag
-
-
Constructor Summary
Constructors Constructor Description LocalVariableTypeTable(int nameIndex, int length, LocalVariable[] localVariableTypeTable, ConstantPool constantPool)Constructs a new LocalVariableTypeTable.LocalVariableTypeTable(LocalVariableTypeTable c)Constructs a copy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Visitor v)Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.Attributecopy(ConstantPool constantPool)Creates a deep copy of this attribute.voiddump(java.io.DataOutputStream file)Dumps attribute to file stream in binary format.LocalVariablegetLocalVariable(int index)Gets the local variable for the given index.LocalVariable[]getLocalVariableTypeTable()Gets the local variable type table.intgetTableLength()Gets the table length.java.util.Iterator<LocalVariable>iterator()voidsetLocalVariableTable(LocalVariable[] localVariableTable)Sets the local variable table.java.lang.StringtoString()-
Methods inherited from class org.apache.bcel.classfile.Attribute
addAttributeReader, addAttributeReader, clone, getConstantPool, getLength, getName, getNameIndex, getTag, println, readAttribute, readAttribute, removeAttributeReader, setConstantPool, setLength, setNameIndex
-
-
-
-
Constructor Detail
-
LocalVariableTypeTable
public LocalVariableTypeTable(int nameIndex, int length, LocalVariable[] localVariableTypeTable, ConstantPool constantPool)
Constructs a new LocalVariableTypeTable.- Parameters:
nameIndex- index into constant pool.length- content length in bytes.localVariableTypeTable- The local variable type table.constantPool- The constant pool.
-
LocalVariableTypeTable
public LocalVariableTypeTable(LocalVariableTypeTable c)
Constructs a copy.- Parameters:
c- The instance to copy.
-
-
Method Detail
-
accept
public void accept(Visitor v)
Description copied from class:AttributeCalled by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.
-
copy
public Attribute copy(ConstantPool constantPool)
Description copied from class:AttributeCreates a deep copy of this attribute.
-
dump
public final void dump(java.io.DataOutputStream file) throws java.io.IOException
Description copied from class:AttributeDumps attribute to file stream in binary format.
-
getLocalVariable
public final LocalVariable getLocalVariable(int index)
Gets the local variable for the given index.- Parameters:
index- The index.- Returns:
- The local variable or null if not found.
-
getLocalVariableTypeTable
public final LocalVariable[] getLocalVariableTypeTable()
Gets the local variable type table.- Returns:
- The local variable type table.
-
getTableLength
public final int getTableLength()
Gets the table length.- Returns:
- The table length.
-
iterator
public java.util.Iterator<LocalVariable> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<LocalVariable>
-
setLocalVariableTable
public final void setLocalVariableTable(LocalVariable[] localVariableTable)
Sets the local variable table.- Parameters:
localVariableTable- The local variable table to set.
-
-