KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > gjt > jclasslib > structures > attributes > LocalVariableTypeTableEntry


1 /*
2     This library is free software; you can redistribute it and/or
3     modify it under the terms of the GNU General Public
4     License as published by the Free Software Foundation; either
5     version 2 of the license, or (at your option) any later version.
6 */

7 package org.gjt.jclasslib.structures.attributes;
8
9 import org.gjt.jclasslib.structures.ClassFile;
10 import org.gjt.jclasslib.structures.InvalidByteCodeException;
11
12 import java.io.DataInput JavaDoc;
13 import java.io.IOException JavaDoc;
14
15 /**
16  * Describes an <tt>LocalVariableTypeTableEntry</tt> attribute structure.
17  *
18  * @author <a HREF="mailto:vitor.carreira@gmail.com">Vitor Carreira</a>
19  * @version $Revision: 1.1 $ $Date: 2004/12/28 13:04:32 $
20  */

21 public class LocalVariableTypeTableEntry extends LocalVariableCommonEntry {
22     /**
23      * Factory method for creating <tt>LocalVariableTypeTableEntry</tt> structures.
24      *
25      * @param in the <tt>DataInput</tt> from which to read the
26      * <tt>LocalVariableTypeTableEntry</tt> structure
27      * @param classFile the parent class file of the structure to be created
28      * @return the new <tt>LocalVariableTypeTableEntry</tt> structure
29      * @throws org.gjt.jclasslib.structures.InvalidByteCodeException
30      * if the byte code is invalid
31      * @throws java.io.IOException if an exception occurs with the <tt>DataInput</tt>
32      */

33     public static LocalVariableTypeTableEntry create(DataInput JavaDoc in, ClassFile classFile)
34             throws InvalidByteCodeException, IOException JavaDoc {
35
36         LocalVariableTypeTableEntry localVariableTypeTableEntry = new LocalVariableTypeTableEntry();
37         localVariableTypeTableEntry.setClassFile(classFile);
38         localVariableTypeTableEntry.read(in);
39
40         return localVariableTypeTableEntry;
41     }
42
43     /**
44      * Get the index of the constant pool entry containing the signature of
45      * this local variable.
46      *
47      * @return the index
48      */

49     public int getSignatureIndex() {
50         return descriptorOrSignatureIndex;
51     }
52
53     /**
54      * Get the index of the constant pool entry containing the signature of
55      * this local variable.
56      *
57      * @param signatureIndex the index
58      */

59     public void setSignatureIndex(int signatureIndex) {
60         this.descriptorOrSignatureIndex = signatureIndex;
61     }
62
63     protected void debug(String JavaDoc message) {
64         super.debug(message +
65                 "LocalVariableTypeTable entry with start_pc " + startPc +
66                 ", length " + length + ", name_index " + nameIndex +
67                 ", signature_index " + descriptorOrSignatureIndex +
68                 ", index " + index);
69     }
70 }
71
Popular Tags