1 7 package org.gjt.jclasslib.structures.attributes; 8 9 import org.gjt.jclasslib.structures.InvalidByteCodeException; 10 11 import java.io.DataInput ; 12 import java.io.IOException ; 13 14 20 public class LocalVariableTypeTableAttribute extends LocalVariableCommonAttribute { 21 22 25 public static final String ATTRIBUTE_NAME = "LocalVariableTypeTable"; 26 27 33 public LocalVariableTypeTableEntry[] getLocalVariableTypeTable() { 34 return (LocalVariableTypeTableEntry[])localVariableTable; 35 } 36 37 43 public void setLocalVariableTypeTable(LocalVariableTypeTableEntry[] localVariableTypeTable) { 44 this.localVariableTable = localVariableTypeTable; 45 } 46 47 public void read(DataInput in) 48 throws InvalidByteCodeException, IOException { 49 super.read(in); 50 51 int localVariableTypeTableLength = in.readUnsignedShort(); 52 localVariableTable = new LocalVariableTypeTableEntry[localVariableTypeTableLength]; 53 for (int i = 0; i < localVariableTypeTableLength; i++) { 54 localVariableTable[i] = LocalVariableTypeTableEntry.create(in, classFile); 55 } 56 57 if (debug) debug("read "); 58 } 59 60 public int getAttributeLength() { 61 return INITIAL_LENGTH + getLength(localVariableTable) * LocalVariableTypeTableEntry.LENGTH; 62 } 63 64 protected void debug(String message) { 65 super.debug(message + "LocalVariableTypeTable attribute with " + 66 getLength(localVariableTable) + " entries"); 67 } 68 } 69 | Popular Tags |