Package org.apache.bcel.verifier.statics
Class LocalVariableInfo
java.lang.Object
org.apache.bcel.verifier.statics.LocalVariableInfo
A utility class holding the information about
the name and the type of a local variable in
a given slot (== index). This information
often changes in course of byte code offsets.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds some information about this local variable (slot).getName
(int offset) Returns the name of the local variable that uses this local variable slot at the given bytecode offset.getType
(int offset) Returns the type of the local variable that uses this local variable slot at the given bytecode offset.
-
Constructor Details
-
LocalVariableInfo
public LocalVariableInfo()
-
-
Method Details
-
getType
Returns the type of the local variable that uses this local variable slot at the given bytecode offset. Care for legal bytecode offsets yourself, otherwise the return value might be wrong. May return 'null' if nothing is known about the type of this local variable slot at the given bytecode offset.- Parameters:
offset
- bytecode offset.- Returns:
- the type of the local variable that uses this local variable slot at the given bytecode offset.
-
getName
Returns the name of the local variable that uses this local variable slot at the given bytecode offset. Care for legal bytecode offsets yourself, otherwise the return value might be wrong. May return 'null' if nothing is known about the type of this local variable slot at the given bytecode offset.- Parameters:
offset
- bytecode offset.- Returns:
- the name of the local variable that uses this local variable slot at the given bytecode offset.
-
add
public void add(String name, int startPc, int length, Type type) throws LocalVariableInfoInconsistentException Adds some information about this local variable (slot).- Parameters:
name
- variable namestartPc
- Range in which the variable is valid.length
- length of ...type
- variable type- Throws:
LocalVariableInfoInconsistentException
- if the new information conflicts with already gathered information.
-