Site Tools


Sidebar

Smart Card Solution

User Manual

JavaCard API Samples

Java Card Specification

Knowledge Sharing

javacard:jcvm:5.9_methods

5.9 Methods

Each method is described by a variable-length method_info structure. The format of this structure is:

The items of the method_info structure are as follows:

token

The token item is the token assigned to this method. If this method is a static method or constructor, the token item represents a static method token ( Section 4.3.7.4, Static Methods and Constructors). If this method is a virtual method, the token item represents a virtual method token ( Section 4.3.7.6, Virtual Methods). If this method is an interface method, the token item represents an interface method token ( Section 4.3.7.7, Interface Methods).

access_flags

The value of the access_flags item is a mask of modifiers used with methods. The access_flags modifiers are shown in the following table.

Name

Value

Meaning

Used By

ACC_PUBLIC

0x0001

Is public; may be accessed from outside its package.

Any method

ACC_PROTECTED

0x0004

Is protected; may be accessed within subclasses.

Class/instance method

ACC_STATIC

0x0008

Is static.

Class/instance method

ACC_FINAL

0x0010

Is final; no further overriding or assignment after initialization.

Class/instance method

ACC_ABSTRACT

0x0400

Is abstract; no implementation is provided

Any method

Method access and modifier flags are defined in the same way and with the same restrictions as described in The Java Virtual Machine Specification.

Since all methods represented in an export file are either public or protected, exactly one of the ACC_PUBLIC or ACC_PROTECTED flag must be set.

Unlike in Java class files, the ACC_NATIVE flag is not supported in export files. Whether a method is native is an implementation detail that is not relevant to importing packages. The Java Card virtual machine reserves all other flag values. Their values must be zero.

name_index

The value of the 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 either the special internal method name for constructors, , or a valid Java method name stored as a simple (not fully qualified) name.

descriptor_index

The value of the descriptor_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 a valid Java method descriptor.

Representation of a method descriptor in an export file is the same as in a Java class file. See the specification described in The Java Virtual Machine Specification ( Section 4.3.3, The Export File and Conversion).

All classes referenced in a descriptor must be public classes.

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