OT Bytecode Attributes/BaseClassTags

From Eclipsepedia

Jump to: navigation, search

Contents

Attribute BaseClassTags

Versions

This attribute was used in the OTDT versions ≤ 1.3.2.

It is obsolete since this change: http://trac.objectteams.org/ot/changeset/22847.

See also bug 318781.

Intent

This attribute contains the mappings of base classes to base class tags of one Team. The BaseClassTags attribute is a variable-length attribute used in the attributes table of the ClassFile structure.

Location:

A team class with bound role classes. Every base class bound to a role class in this team gets a unique value attached.

Content:

A list of pairs of base class name + tag.

Purpose:

The lift methods use this tag to differentiate the dynamic type of the base object. The OTRE generates team specific base class tags fields into every base class which is adapted by a team. This tag fields are initialized by the tags of this attribute.

Format:

   BaseClassTags {
     u2 attribute_name_index;
     u4 attribute_length;
     u2 base_class_tag_count;
     BaseTag base_tags[base_calss_tag_count];
    }
   
    BaseTag {
     u2 base_class_name_index;
     u2 base_class_tag;
    }

The items of the BaseClassTags structure are as follows:

  • attribute_name_index
The constant_pool entry at that index must be a CONSTANT_Utf8_info representing the string "CallinRoleBaseBindings".
  • attribute_length
The value of the attribute_length item indicates the length of the attribute, excluding the initial six bytes.
  • base_class_tag_count
The value of the base_class_tag_count item indicates the number of entries in the base_tags array.
  • base_tags[]
Every base class B which is adapted by this (team) class is listed here. Each base_tags array entry contains the following two items:
  • base_class_name_index
The constant_pool index representing the fully qualified name of B, as given in the source code from which this class file was compiled.
  • base_class_tag
The tag mapped to B in this class.