javassist.bytecode
public class ParameterAnnotationsAttribute extends AttributeInfo
RuntimeVisibleAnnotations_attribute and
RuntimeInvisibleAnnotations_attribute.
To obtain an ParameterAnnotationAttribute object, invoke
getAttribute(ParameterAnnotationsAttribute.invisibleTag)
in MethodInfo.
The obtained attribute is a
runtime invisible annotations attribute.
If the parameter is
ParameterAnnotationAttribute.visibleTag, then the obtained
attribute is a runtime visible one.
| Field Summary | |
|---|---|
| static String | invisibleTag
The name of the RuntimeInvisibleParameterAnnotations
attribute. |
| static String | visibleTag
The name of the RuntimeVisibleParameterAnnotations
attribute. |
| Constructor Summary | |
|---|---|
| ParameterAnnotationsAttribute(ConstPool cp, String attrname, byte[] info)
Constructs
a Runtime(In)VisisbleParameterAnnotations_attribute.
| |
| ParameterAnnotationsAttribute(ConstPool cp, String attrname)
Constructs an empty
Runtime(In)VisisbleParameterAnnotations_attribute.
| |
| Method Summary | |
|---|---|
| AttributeInfo | copy(ConstPool newCp, Map classnames)
Copies this attribute and returns a new copy. |
| Annotation[][] | getAnnotations()
Parses the annotations and returns a data structure representing
that parsed annotations. |
| int | numParameters()
Returns num_parameters. |
| void | setAnnotations(Annotation[][] params)
Changes the annotations represented by this object according to
the given array of Annotation objects.
|
RuntimeInvisibleParameterAnnotations
attribute.RuntimeVisibleParameterAnnotations
attribute.Runtime(In)VisisbleParameterAnnotations_attribute.
Parameters: cp constant pool attrname attribute name (visibleTag or
invisibleTag). info the contents of this attribute. It does not
include attribute_name_index or
attribute_length.
Runtime(In)VisisbleParameterAnnotations_attribute.
A new annotation can be later added to the created attribute
by setAnnotations().
Parameters: cp constant pool attrname attribute name (visibleTag or
invisibleTag).
See Also: (Annotation[][])
setAnnotations().
Returns: Each element of the returned array represents an array of annotations that are associated with each method parameter.
See Also: (Annotation[][])
num_parameters.Annotation objects.
Parameters: params the data structure representing the
new annotations. Every element of this array
is an array of Annotation and
it represens annotations of each method parameter.