The RuntimeInvisibleParameterAnnotations attribute is a variable-length attribute in the attributes table of a method_info structure (§4.6). The RuntimeInvisibleParameterAnnotations attribute stores run-time invisible annotations on the declarations of formal parameters of the corresponding method.
There may be at most one RuntimeInvisibleParameterAnnotations attribute in the attributes table of a method_info structure.
The RuntimeInvisibleParameterAnnotations attribute is similar to the RuntimeVisibleParameterAnnotations attribute (§4.7.18), except that the annotations represented by a RuntimeInvisibleParameterAnnotations attribute must not be made available for return by reflective APIs, unless the Java Virtual Machine has specifically been instructed to retain these annotations via some implementation-specific mechanism such as a command line flag. In the absence of such instructions, the Java Virtual Machine ignores this attribute.
The RuntimeInvisibleParameterAnnotations attribute has the following format:
RuntimeInvisibleParameterAnnotations_attribute {
u2 attribute_name_index;
u4 attribute_length;
u1 num_parameters;
{ u2 num_annotations;
annotation annotations[num_annotations];
} parameter_annotations[num_parameters];
}
The items of the RuntimeInvisibleParameterAnnotations_attribute structure are as follows:
-
attribute_name_index
The value of the
attribute_name_indexitem must be a valid index into theconstant_pooltable. Theconstant_poolentry at that index must be aCONSTANT_Utf8_infostructure (§4.4.7) representing the string "RuntimeInvisibleParameterAnnotations". -
attribute_length
The value of the
attribute_lengthitem indicates the length of the attribute, excluding the initial six bytes. -
num_parameters
The value of the
num_parametersitem gives the number of run-time invisible parameter annotations represented by this structure.There is no assurance that this number is the same as the number of parameter descriptors in the method descriptor.
-
parameter_annotations[]
Each entry in the
parameter_annotationstable represents all of the run-time invisible annotations on the declaration of a single formal parameter. Eachparameter_annotationsentry contains the following two items:-
num_annotations
The value of the
num_annotationsitem indicates the number of run-time invisible annotations on the declaration of the formal parameter corresponding to theparameter_annotationsentry. -
annotations[]
Each entry in the
annotationstable represents a single run-time invisible annotation on the declaration of the formal parameter corresponding to theparameter_annotationsentry. Theannotationstructure is specified in §4.7.16.
The i'th entry in the
parameter_annotationstable may, but is not required to, correspond to the i'th parameter descriptor in the method descriptor (§4.3.3).See the note in §4.7.18 for an example of when
parameter_annotations[0]does not correspond to the first parameter descriptor in the method descriptor. -