FileDocCategorySizeDatePackage
LocalVariableTableAttribute.javaAPI DocGlassfish v2 API3992Fri May 04 22:34:28 BST 2007com.sun.jdo.api.persistence.enhancer.classfile

LocalVariableTableAttribute

public class LocalVariableTableAttribute extends ClassAttribute
Represents the LocalVariableTable attribute within a method in a class file.

Fields Summary
public static final String
expectedAttrName
private Vector
localTable
Constructors Summary
public LocalVariableTableAttribute(ConstUtf8 nameAttr, Vector lvarTable)
Constructor for a local variable table

    super(nameAttr);
    localTable = lvarTable;
  
Methods Summary
voidprint(java.io.PrintStream out, int indent)

    ClassPrint.spaces(out, indent);
    out.println("LocalVariables: ");//NOI18N
    for (int i=0; i<localTable.size(); i++) {
      ((LocalVariable) localTable.elementAt(i)).print(out, indent+2);
    }
  
static com.sun.jdo.api.persistence.enhancer.classfile.LocalVariableTableAttributeread(ConstUtf8 attrName, java.io.DataInputStream data, CodeEnv env)

    int nVars = data.readUnsignedShort();
    Vector lvarTable = new Vector();
    while (nVars-- > 0) {
      lvarTable.addElement(LocalVariable.read(data, env));
    }
        
    return new LocalVariableTableAttribute(attrName, lvarTable);
  
java.util.Enumerationvariables()
Returns an enumeration of the local variables in the table Each element is a LocalVariable


  /* public accessors */

                    
    
    return localTable.elements();
  
voidwrite(java.io.DataOutputStream out)

    out.writeShort(attrName().getIndex());
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DataOutputStream tmp_out = new DataOutputStream(baos);
    tmp_out.writeShort(localTable.size());
    for (int i=0; i<localTable.size(); i++)
      ((LocalVariable) localTable.elementAt(i)).write(tmp_out);

    tmp_out.flush();
    byte tmp_bytes[] = baos.toByteArray();
    out.writeInt(tmp_bytes.length);
    out.write(tmp_bytes, 0, tmp_bytes.length);