Package serp.bytecode
Class LocalVariableTypeTable
java.lang.Object
serp.bytecode.Attributes
serp.bytecode.Attribute
serp.bytecode.LocalTable
serp.bytecode.LocalVariableTypeTable
- All Implemented Interfaces:
BCEntity
,InstructionPtr
,VisitAcceptor
Code blocks compiled from source have local variable type tables mapping
generics-using locals used in opcodes to their names and signatures.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
acceptVisit
(BCVisitor visit) Accept a visit from aBCVisitor
, calling the appropriate methods to notify the visitor that it has entered this entity, and to provide it with the proper callbacks for each sub-entity owned by this one.Add a local to this table.addLocalVariableType
(String name, String type) Add a local to this table.Import a local from another method/class.getLocalVariableType
(int local) Return the local with the given locals index, or null if none.getLocalVariableType
(String name) Return the local with the given name, or null if none.Return all the locals of this method.getLocalVariableTypes
(String name) Return all locals with the given name, or empty array if none.protected Local
newLocal()
Create a new element of this table.protected Local[]
newLocalArray
(int size) Create a new array.Methods inherited from class serp.bytecode.LocalTable
addLocal, addLocal, addLocal, clear, getCode, getLength, getLocal, getLocal, getLocals, getLocals, read, read, removeLocal, removeLocal, removeLocal, replaceTarget, setLocals, updateTargets, write
Methods inherited from class serp.bytecode.Attribute
create, getAttributesHolder, getClassLoader, getName, getNameIndex, getOwner, getPool, getProject, invalidate, isValid
Methods inherited from class serp.bytecode.Attributes
addAttribute, addAttribute, clearAttributes, getAttribute, getAttributes, getAttributes, readAttributes, removeAttribute, removeAttribute, setAttributes, visitAttributes, writeAttributes
-
Constructor Details
-
LocalVariableTypeTable
LocalVariableTypeTable(int nameIndex, Attributes owner)
-
-
Method Details
-
getLocalVariableTypes
Return all the locals of this method. -
getLocalVariableType
Return the local with the given locals index, or null if none. -
getLocalVariableType
Return the local with the given name, or null if none. If multiple locals have the given name, which is returned is undefined. -
getLocalVariableTypes
Return all locals with the given name, or empty array if none. -
addLocalVariableType
Import a local from another method/class. Note that the program counter and length from the given local is copied directly, and thus will be incorrect unless this method is the same as the one the local is copied from, or the pc and length are reset. -
addLocalVariableType
Add a local to this table. -
addLocalVariableType
Add a local to this table. -
acceptVisit
Description copied from interface:VisitAcceptor
Accept a visit from aBCVisitor
, calling the appropriate methods to notify the visitor that it has entered this entity, and to provide it with the proper callbacks for each sub-entity owned by this one. -
newLocal
Description copied from class:LocalTable
Create a new element of this table.- Specified by:
newLocal
in classLocalTable
-
newLocalArray
Description copied from class:LocalTable
Create a new array.- Specified by:
newLocalArray
in classLocalTable
-