4.7. Attributes

Attributes are used in the ClassFile4.1), field_info4.5), method_info4.6) and Code_attribute4.7.3) structures of the class file format. All attributes have the following general format:

attribute_info {    u2 attribute_name_index;    u4 attribute_length;    u1 info[attribute_length];}

For all attributes, the attribute_name_index must be a valid unsigned 16-bit index into the constant pool of the class. The constant_pool entry at attribute_name_index must be a CONSTANT_Utf8_info4.4.7) structure representing the name of the attribute. The value of the attribute_length item indicates the length of the subsequent information in bytes. The length does not include the initial six bytes that contain the attribute_name_index ...

Get The Java® Virtual Machine Specification, Java SE 7 Edition, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.