Site Tools

Sidebar

Smart Card Solution

User Manual

JavaCard API Samples

Java Card Specification

Knowledge Sharing

javacard:jcvm:5.10.1_constantvalue_attribute

5.10.1 ConstantValue Attribute

The 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 final static field (compile-time constant); that is, both the ACC_STATIC and ACC_FINAL bits in the flags item of the field_info structure must be set. There can be no more than one ConstantValue attribute in the attributes table of a given field_info structure.

The ConstantValue attribute has the format:

The items of the ConstantValue_attribute structure are as follows:

attribute_name_index

The value of the attribute_name_index item must be a valid index into the constant_pool table. The constant_pool entry at that index must be a CONSTANT_Utf8_info ( Section 5.6.4, CONSTANT_Utf8) structure representing the string “ConstantValue.”

attribute_length

The value of the attribute_length item of a ConstantValue_attribute structure must be 2.

constantvalue_index

The value of the constantvalue_index item 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 CONSTANT_Integer ( Section 5.6.3, **CONSTANT_Integer**).

Copyright © 2005, Sun Microsystems, Inc. All Rights Reserved.

javacard/jcvm/5.10.1_constantvalue_attribute.txt · Last modified: 2017/05/13 04:09 (external edit)