FileDocCategorySizeDatePackage
JAttribute.javaAPI DocphoneME MR2 API (J2ME)2496Wed May 02 18:00:40 BST 2007com.sun.satsa.jcrmic.classfile.attributes

JAttribute

public class JAttribute extends Object
This class is the base class for all Java class file attributes. It also contain a factory method to create an attribute object based on the attribute type.

Fields Summary
protected com.sun.satsa.jcrmic.classfile.constants.JConstantPool
cp
Constant pool reference.
Constructors Summary
JAttribute(com.sun.satsa.jcrmic.classfile.constants.JConstantPool cp)
Constructor.

param
cp constant pool reference

        this.cp = cp;
    
Methods Summary
public static final com.sun.satsa.jcrmic.classfile.attributes.JAttributecreate(com.sun.satsa.jcrmic.classfile.constants.JConstantPool cp, int index)
Factory method for attribute object creation.

param
cp constant pool reference
param
index constant pool index for attribute name
return
attribute object


        String name = cp.getConstantUtf8(index).getString();
        if (name.equals("Exceptions"))
            return new JExceptionsAttr(cp);
        return new JAttribute(cp);
    
public voidparse(java.io.DataInputStream dis)
Parses the attribute definition.

param
dis input stream
throws
IOException if I/O exception occurs

        int length = dis.readInt();
        dis.skipBytes(length);
    
public voidresolve()
Resolves the attribute.