All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----harpoon.ClassFile.Raw.Attribute.Attribute | +----harpoon.ClassFile.Raw.Attribute.AttributeConstantValue
ConstantValue
attribute is a fixed-length
attribute used in the attributes
table of the
field_info
structures. A ConstantValue
attribute represents the value of a constant field that must be
(explicitly or implicitly) static
; that is, the
ACC_STATIC
bit in the flags
item of the
field_info
structure must be set. The field is not
required to be final
. There can be no more than one
ConstantValue
attribute in the attributes
table of a given field_info
structure. The constant
field represented by the field_info
structure is
assigned the value referenced by its ConstantValue
attribute as part of its initialization.
CORRECTION FROM ERRATA:
If a non-static field has a ConstantValue
attribute, then
the attribute is silently ignored.
constantvalue_index
must be a
valid index into the constant_pool
table.
attribute_length
item indicates
the length of the attribute, excluding the initial six bytes.
public int constantvalue_index
constantvalue_index
must be a
valid index into the constant_pool
table. The
constant_pool
entry at that index must give the
constant value represented by this attribute. The
constant_pool
entry must be of a type appropriate
to the field.
public AttributeConstantValue(ClassFile parent, int attribute_name_index, int constantvalue_index)
public long attribute_length()
attribute_length
item indicates
the length of the attribute, excluding the initial six bytes.
public Constant constantvalue_index()
public void write(ClassDataOutputStream out) throws IOException
public void print(PrintWriter pw, int indent)
All Packages Class Hierarchy This Package Previous Next Index