Site Tools

Sidebar

Smart Card Solution

User Manual

JavaCard API Samples

Java Card Specification

Knowledge Sharing

javacard:jcvm:6.8.2.3_class_info_items

6.8.2.3 class_info Items

super_class_ref

The super_class_ref item of the class_info structure is a class_ref structure representing the superclass of this class. The class_ref structure is defined as part of the CONSTANT_Classref_info structure ( Section 6.7.1, CONSTANT_Classref).

The super_class_ref item has the value of 0xFFFF only if this class does not have a superclass. Otherwise the value of the super_class_ref item is limited only by the constraints of the class_ref structure.

declared_instance_size

The declared_instance_size item of the class_info structure represents the number of 16-bit cells required to represent the instance fields declared by this class. It does not include instance fields declared by superclasses of this class.

Instance fields of type int are represented in two 16-bit cells, while all other field types are represented in one 16-bit cell.

first_reference_token

The first_reference_token item of the class_info structure represents the instance field token ( Section 4.3.7.5, Instance Fields) value of the first reference type instance field defined by this class. It does not include instance fields defined by superclasses of this class.

If this class does not define any reference type instance fields, the value of the first_reference_token is 0xFF. Otherwise the value of the first_reference_token item must be within the range of the set of instance field tokens of this class.

reference_count

The reference_count item of the class_info structure represents the number of reference type instance field defined by this class. It does not include reference type instance fields defined by superclasses of this class.

Valid values of the reference_count item are between 0 and the maximum number of instance fields defined by this class.

public_method_table_base

The public_method_table_base item of the class_info structure is equal to the virtual method token value ( Section 4.3.7.6, Virtual Methods) of the first method in the public_virtual_method_table[] array. If the public_virtual_method_table[] array is empty, the value of the public_method_table_base item is equal to the public_method_table_base item of the class_info structure of this class' superclass plus the public_method_table_count item of the class_info structure of this class' superclass. If this class has no superclass and the public_virtual_method_table[] array is empty, the value of the public_method_table_base item is zero.

public_method_table_count

The public_method_table_count item of the class_info structure indicates the number of entries in the public_virtual_method_table[] array.

If this class does not define any public or protected override methods, the minimum valid value of public_method_table_count item is the number of public and protected virtual methods declared by this class. If this class defines one or more public or protected override methods, the minimum valid value of public_method_table_count item is the value of the largest public or protected virtual method token, minus the value of the smallest public or protected virtual override method token, plus one.

The maximum valid value of the public_method_table_count item is the value of the largest public or protected virtual method token, plus one.

Any value for the public_method_table_count item between the minimum and maximum specified here is valid. However, the value must correspond to the number of entries in the public_virtual_method_table[] array.

package_method_table_base

The package_method_table_base item of the class_info structure is equal to the virtual method token value ( Section 4.3.7.6, Virtual Methods) of the first entry in the package_virtual_method_table[] array. If the package_virtual_method_table[] array is empty, the value of the package_method_table_base item is equal to the package_method_table_base item of the class_info structure of this class' superclass, plus the package_method_table_count item of the class_info structure of this class' superclass. If this class has no superclass or inherits from a class defined in another package and the package_virtual_method_table[] array is empty, the value of the package_method_table_base item is zero.

package_method_table_count

The package_method_table_count item of the class_info structure indicates the number of entries in the package_virtual_method_table[] array.

If this class does not define any override methods, the minimum valid value of package_method_table_count item is the number of package visible virtual methods declared by this class. If this class defines one or more package visible override methods, the minimum valid value of package_method_table_count item is the value of the largest package visible virtual method token, minus the value of the smallest package visible virtual override method token, plus one.

The maximum valid value of the package_method_table_count item is the value of the largest package visible method token, plus one.

Any value for the package_method_table_count item between the minimum and maximum specified here are valid. However, the value must correspond to the number of entries in the package_virtual_method_table[].

public_virtual_method_table[]

The public_virtual_method_table[] item of the class_info structure represents an array of public and protected virtual methods. These methods can be invoked on an instance of this class. The public_virtual_method_table[] array includes methods declared or defined by this class. It may also include methods declared or defined by any or all of its superclasses. The value of an index into this table must be equal to the value of the virtual method token of the indicated method, minus the value of the public_method_table_base item.

Entries in the public_virtual_method_table[] array that represent methods defined or declared in this package contain offsets into the info item of the Method Component ( Section 6.9, Method Component) to the method_info structure representing the method. Entries that represent methods defined or declared in an imported package contain the value 0xFFFF.

Entries for methods that are declared abstract are represented in the public_virtual_method_table[] array in the same way as non-abstract methods.

package_virtual_method_table[]

The package_virtual_method_table[] item of the class_info structure represents an array of package-visible virtual methods. These methods can be invoked on an instance of this class. The package_virtual_method_table[] array includes methods declared or defined by this class. It may also include methods declared or defined by any or all of its superclasses that are defined in this package. The value of an index into this table must be equal to the value of the virtual method token of the indicated method & 0x7F, minus the value of the package_method_table_base item.

All entries in the package_virtual_method_table[] array represent methods defined or declared in this package. They contain offsets into the info item of the Method Component ( Section 6.9, Method Component) to the method_info structure representing the method.

Entries for methods that are declared abstract, not including those defined by interfaces, are represented in the package_virtual_method_table[] array in the same way as non-abstract methods.

interfaces[]

The interfaces item of the class_info structure represents a table of variable-length implemented_interface_info structures. The table must contain an entry for each of the directly implemented interfaces indicated in the declaration of this class and each of the interfaces in the hierarchies of those interfaces. Interfaces that occur more than once are represented by a single entry.

Given the declarations below, the number of entries for class c0 is 1 and the entry in the interfaces array is i0. The number of entries for class c1 is 3 and the entries in the interfaces array are i1, i2, and i3. The entries for class c1 must not include interface i0, which is implemented only by the superclass of c1.

remote_interfaces

The remote_interfaces item represents information required if this class or any of its super classes implements a remote interface. This item must be omitted if the ACC_REMOTE flag has a value of zero. The remote_interfaces item is defined by a remote_interface_info structure.

javacard/jcvm/6.8.2.3_class_info_items.txt · Last modified: 2017/05/13 04:11 (external edit)