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

ConstantValueAttribute

public class ConstantValueAttribute extends ClassAttribute
ConstantValueAttribute represents a constant value attribute in a class file. These attributes are used as initialization values for static fields.

Fields Summary
public static final String
expectedAttrName
private ConstValue
constantValue
Constructors Summary
public ConstantValueAttribute(ConstUtf8 attrName, ConstValue value)
Construct a constant value attribute

    super(attrName);
    constantValue = value;
  
Methods Summary
voidprint(java.io.PrintStream out, int indent)

    ClassPrint.spaces(out, indent);
    out.println("ConstantValue: " + constantValue.toString());//NOI18N
  
static com.sun.jdo.api.persistence.enhancer.classfile.ConstantValueAttributeread(ConstUtf8 attrName, java.io.DataInputStream data, ConstantPool pool)

    int index = 0;
    index = data.readUnsignedShort();

    return new ConstantValueAttribute(attrName,
                 (ConstValue) pool.constantAt(index));
  
public ConstValuevalue()


  /* public accessors */

     
    return constantValue;
  
voidwrite(java.io.DataOutputStream out)

    out.writeShort(attrName().getIndex());
    out.writeInt(2);
    out.writeShort(constantValue.getIndex());