Next: , Previous: Field Attributes, Up: Encoding of BML in Class File Format


7.4 Method Attributes

BML-related method attributes are added as additional attributes to regular methods in the Method table (see Methods Data Structure). The attributes are as follows:

7.4.1 MethodSpecification Attribute

This attribute contains the specification of a single method, without references to its implementation (as specified in the Code Attribute).

     MethodSpecification_attribute {
       u2 attribute_name_index;
       u4 attribute_length;
       u4 BML_flags;
       formula_info spec_requires;
       u2 assignable_count;
       assignable_info assignable[assignable_count];
       formula_info ensures_formula;
       u2 signals_count;
       {
         u2 exception_index;
         formula_info signals_formula;
       } signals[signals_count];
       u2 signals_only_count;
       u2 signals_only_indexes[signals_only_count];
     }

The meaning of the fields is as follows:

7.4.2 ParameterTable Attribute

The ParameterTable attribute represents the BML related information about the method parameters. The structure of the attribute is as follows:

     ParameterTable_attribute {
       u2 attribute_name_index;
       u4 attribute_length;
       u2 parameters_count;
       {
         u2 name_index;
         u2 access_flags;
         u4 BML_flags;
         u2 index;
       } parameters[parameters_count];
     }

The meaning of the fields is as follows:

Note that for methods where the Code attribute (see Methods Data Structure) contains a LocalVariableTable attribute (see again Methods Data Structure) the parameter names can already be stored in this table. In this case the two names must be equal. However, for methods without the Code attribute (because they are declared in an interface, abstract or native) the parameter's name is only stored in this attribute.

The index field in each parameter description must correspond to the index by which this parameter is referenced in the code (if it is present) and BML expressions in the method specification and other formulas in the method's code. Note that if there are long integer or double float parameters in the list, the value of the index does not have to be equal to the position of the parameter in the method's signature.

The order of parameters is not specified and not all of them must be described in the table, but any parameter must be described at most once.