1 25 26 package org.netbeans.modules.classfile; 27 28 import java.io.DataInputStream ; 29 import java.io.IOException ; 30 31 41 public final class LocalVariableTypeTableEntry { 42 43 int startPC; 44 int length; 45 String name; 46 String signature; 47 int index; 48 49 static LocalVariableTypeTableEntry[] loadLocalVariableTypeTable(DataInputStream in, ConstantPool pool) 50 throws IOException { 51 int n = in.readUnsignedShort(); 52 LocalVariableTypeTableEntry[] entries = new LocalVariableTypeTableEntry[n]; 53 for (int i = 0; i < n; i++) 54 entries[i] = new LocalVariableTypeTableEntry(in, pool); 55 return entries; 56 } 57 58 59 LocalVariableTypeTableEntry(DataInputStream in, ConstantPool pool) 60 throws IOException { 61 loadLocalVariableEntry(in, pool); 62 } 63 64 private void loadLocalVariableEntry(DataInputStream in, ConstantPool pool) 65 throws IOException { 66 startPC = in.readUnsignedShort(); 67 length = in.readUnsignedShort(); 68 Object o = pool.get(in.readUnsignedShort()); 69 if (!(o instanceof CPUTF8Info)) 70 throw new InvalidClassFormatException(); 71 CPUTF8Info entry = (CPUTF8Info)o; 72 name = entry.getName(); 73 o = pool.get(in.readUnsignedShort()); 74 if (!(o instanceof CPUTF8Info)) 75 throw new InvalidClassFormatException(); 76 entry = (CPUTF8Info)o; 77 signature = entry.getName(); 78 index = in.readUnsignedShort(); 79 } 80 81 84 public final int getStartPC() { 85 return startPC; 86 } 87 88 92 public final int getLength() { 93 return length; 94 } 95 96 99 public final String getName() { 100 return name; 101 } 102 103 106 public final String getSignature() { 107 return signature; 108 } 109 110 114 public final int getIndex() { 115 return index; 116 } 117 } 118 | Popular Tags |