Package com.ibm.wala.shrike.shrikeCT
Class LocalVariableTableWriter
- java.lang.Object
-
- com.ibm.wala.shrike.shrikeCT.ClassWriter.Element
-
- com.ibm.wala.shrike.shrikeCT.LocalVariableTableWriter
-
public final class LocalVariableTableWriter extends ClassWriter.Element
This class helps emit LocalVariableTable attributes.
-
-
Constructor Summary
Constructors Constructor Description LocalVariableTableWriter(ClassWriter w)Create a blank LocalVariableTable.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcopyInto(byte[] buf, int offset)Copy the bytes into 'buf' at offset 'offset'.intgetSize()static int[]makeRawTable(int[][] varMap, Compiler.Output output)Build a raw local variable table from a formatted variable map.voidsetRawTable(int[] table)Set the raw local variable table values.
-
-
-
Constructor Detail
-
LocalVariableTableWriter
public LocalVariableTableWriter(ClassWriter w)
Create a blank LocalVariableTable.- Throws:
java.lang.IllegalArgumentException- if w is null
-
-
Method Detail
-
setRawTable
public void setRawTable(int[] table)
Set the raw local variable table values. Consider using LocalVariableTableWriter.makeRawTable to build the raw values.- Parameters:
table- the raw values, a flattened sequence of (startPC, length, nameIndex, typeIndex, var) tuples
-
getSize
public int getSize()
- Specified by:
getSizein classClassWriter.Element- Returns:
- the number of bytes that will be generated.
-
copyInto
public int copyInto(byte[] buf, int offset) throws java.lang.IllegalArgumentExceptionDescription copied from class:ClassWriter.ElementCopy the bytes into 'buf' at offset 'offset'.- Specified by:
copyIntoin classClassWriter.Element- Returns:
- the number of bytes copies, which must be equal to getSize()
- Throws:
java.lang.IllegalArgumentException
-
makeRawTable
public static int[] makeRawTable(int[][] varMap, Compiler.Output output) throws java.lang.IllegalArgumentExceptionBuild a raw local variable table from a formatted variable map.- Parameters:
varMap- an array mapping bytecode offsets to a variable map for each offset; a variable map is a array of 2*localVars elements, containing a (nameIndex, typeIndex) for each local variable; the pair (0,0) indicates that there is no information about that local variable at that offset- Throws:
java.lang.IllegalArgumentException- if varMap == null
-
-