Contents Prev Next Up


2.2 Signatures

A signature is a string representing a type of a method, field or array.

The field signature represents the value of an argument to a function or the value of a variable. It is a series of bytes generated by the following grammar:

<field_signature> ::= <field_type>
<field_type> ::= <base_type>|<object_type>|<array_type>
<base_type> ::= B|C|D|F|I|J|S|Z
<object_type> ::= L<fullclassname>;
<array_type> ::= [<optional_size><field_type>
<optional_size> ::= [0-9]*
The meaning of the base types is as follows:

B   byte signed byte
C   char character
D   double double precision IEEE float
F   float single precision IEEE float
I   int integer
J   long long integer
L<fullclassname>;   ... an object of the given class
S   short signed short
Z   boolean true or false
[<field sig>   ... array

A return-type signature represents the return value from a method. It is a series of bytes in the following grammar:

<return_signature> ::= <field_type> | V
The character V indicates that the method returns no value. Otherwise, the signature indicates the type of the return value.

An argument signature represents an argument passed to a method:

<argument_signature> ::= <field_type>
A method signature represents the arguments that the method expects, and the value that it returns.

<method_signature> ::= (<arguments_signature>) <return_signature>
<arguments_signature>: := <argument_signature>*

Contents Prev Next Up