Site Tools


Sidebar

Smart Card Solution

User Manual

JavaCard API Samples

Java Card Specification

Knowledge Sharing

javacard:jcvm:6.12_export_component

6.12 Export Component

The Export Component lists all static elements in this package that may be imported by classes in other packages. Instance fields and virtual methods are not represented in the Export Component.

If this CAP file does not include an Applet Component ( Section 6.5, Applet Component), the Export Component contains an entry for each public class and public interface defined in this package. Furthermore, for each public class there is an entry for each public or protected static field defined in that class, for each public or protected static method defined in that class, and for each public or protected constructor defined in that class. Final static fields of primitive types (compile-time constants) are not included.

If this CAP file includes an Applet Component ( Section 6.5, Applet Component), the Export Component includes entries only for all public interfaces that are shareable.<SUP>[9]</SUP> An interface is shareable if and only if it is the javacard.framework.Shareable interface or implements (directly or indirectly) that interface.

Elements in the Export Component reference elements in the Class Component ( Section 6.8, Class Component), Method Component ( Section 6.9, Method Component), and Static Field Component ( Section 6.10, Static Field Component). No other component in this CAP file references the Export Component.

The Export Component is represented by the following structure:

The items of the export_component structure are as follows:

tag

The tag item has the value COMPONENT_Export (10).

size

The size item indicates the number of bytes in the export_component structure, excluding the tag and size items. The value of the size item must be greater than zero.

class_count

The class_count item represents the number of entries in the class_exports table. The value of the class_count item must be greater than zero.

class_exports[]

The class_exports item represents a variable-length table of class_export_info structures. If this package is a library package, the table contains an entry for each of the public classes and public interfaces defined in this package. If this package is an applet package, the table contains an entry for each of the public shareable interfaces defined in this package.

An index into the table to a particular class or interface is equal to the token value of that class or interface ( Section 4.3.7.2, Classes and Interfaces). The token value is published in the Export file ( Section 5.7, Classes and Interfaces) of this package.

The items in the class_export_info structure are:

class_offset

The class_offset item represents a byte offset into the info item of the Class Component ( Section 6.8, Class Component). If this package defines a library package, the item at that offset must be either an interface_info or a class_info structure. The interface_info or class_info structure at that offset must represent the exported class or interface.

If this package defines an applet package, the item at the class_offset in the info item of the Class Component must be an interface_info structure. The interface_info structure at that offset must represent the exported, shareable interface. In particular, the ACC_SHAREABLE flag of the interface_info structure must be equal to 1.

static_field_count

The static_field_count item represents the number of elements in the static_field_offsets array. This value indicates the number of public and protected static fields defined in this class, excluding final static fields of primitive types.

If the class_offset item represents an offset to an interface_info structure, the value of the static_field_count item must be zero.

static_method_count

The static_method_count item represents the number of elements in the static_method_offsets array. This value indicates the number of public and protected static methods and constructors defined in this class.

If the class_offset item represents an offset to an interface_info structure, the value of the static_method_count item must be zero.

static_field_offsets[]

The static_field_offsets item represents an array of 2-byte offsets into the static field image defined by the Static Field Component ( Section 6.10, Static Field Component). Each offset must be to the beginning of the representation of the exported static field.

An index into the static_field_offsets array must be equal to the token value of the field represented by that entry. The token value is published in the Export file ( Section 5.9, Methods) of this package.

static_method_offsets[]

The static_method_offsets item represents a table of 2-byte offsets into the info item of the Method Component ( Section 6.9, Method Component). Each offset must be to the beginning of a method_info structure. The method_info structure must represent the exported static method or constructor.

An index into the static_method_offsets array must be equal to the token value of the method represented by that entry.

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