Site Tools

Sidebar

Smart Card Solution

User Manual

JavaCard API Samples

Java Card Specification

Knowledge Sharing

javacard:jcvm:6.7.1_constant_classref

6.7.1 CONSTANT_Classref

The CONSTANT_Classref_info structure is used to represent a reference to a class or an interface. The class or interface may be defined in this package or in an imported package.

The items in the CONSTANT_Classref_info structure are the following:

tag

The tag item has the value CONSTANT_Classref (1).

class_ref

The class_ref item represents a reference to a class or interface. If the class or interface is defined in this package the structure represents an internal_class_ref and the high bit of the structure is zero. If the class or interface is defined in another package the structure represents an external_class_ref and the high bit of the structure is one.

internal_class_ref

The internal_class_ref structure represents a 16-bit offset into the info item of the Class Component ( Section 6.8, Class Component) to an interface_info or class_info structure. The interface_info or class_info structure must represent the referenced class or interface.

The value of the internal_class_ref item must be between 0 and 32767, inclusive, making the high bit equal to zero.

external_class_ref

The external_class_ref structure represents a reference to a class or interface defined in an imported package. The high bit of this structure is one.

package_token

The package_token item represents a package token ( Section 4.3.7.1, Package) defined in the Import Component ( Section 6.6, Import Component) of this CAP file. The value of this token must be a valid index into the packages table item of the import_component structure. The package represented at that index must be the imported package.

The value of the package token must be between 0 and 127, inclusive.

The high bit of the package_token item is equal to one.

class_token

The class_token item represents the token of the class or interface ( Section 4.3.7.2, Classes and Interfaces) of the referenced class or interface. It has the value of the class token of the class as defined in the Export file of the imported package.

padding

The padding item has the value zero. It is present to make the size of a CONSTANT_Classref_info structure the same as all other constants in the constant_pool[] array.

javacard/jcvm/6.7.1_constant_classref.txt · Last modified: 2017/05/13 04:10 (external edit)