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


7.6 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.6.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;
       u2 specs_count;
       {
         u2 access_flags;
         formula_info requires;
         assignable_info assignable;
         formula_info ensures;
         u2 signals_exception_index;
         formula_info signals_formula;
         u2 signals_only_count;
         u2 signals_only_indexes[signals_only_count];
       } specs[specs_count];
     }

The meaning of the fields is as follows:

7.6.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 whose the Code Attribute contains a LocalVariableTable Attribute, 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, or are 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.