| java.lang.Object javassist.bytecode.AttributeInfo javassist.bytecode.ParameterAnnotationsAttribute
ParameterAnnotationsAttribute | public class ParameterAnnotationsAttribute extends AttributeInfo (Code) | | A class representing 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 | |
final public static String | invisibleTag The name of the RuntimeInvisibleParameterAnnotations
attribute. | final public static String | visibleTag The name of the RuntimeVisibleParameterAnnotations
attribute. |
Method Summary | |
public AttributeInfo | copy(ConstPool newCp, Map classnames) Copies this attribute and returns a new copy. | public Annotation[][] | getAnnotations() Parses the annotations and returns a data structure representing
that parsed annotations. | public int | numParameters() Returns num_parameters . | public void | setAnnotations(Annotation[][] params) Changes the annotations represented by this object according to
the given array of Annotation objects.
Parameters: params - the data structure representing thenew annotations. |
invisibleTag | final public static String invisibleTag(Code) | | The name of the RuntimeInvisibleParameterAnnotations
attribute.
|
visibleTag | final public static String visibleTag(Code) | | The name of the RuntimeVisibleParameterAnnotations
attribute.
|
ParameterAnnotationsAttribute | public ParameterAnnotationsAttribute(ConstPool cp, String attrname, byte[] info)(Code) | | Constructs
a Runtime(In)VisisbleParameterAnnotations_attribute .
Parameters: cp - constant pool Parameters: attrname - attribute name (visibleTag orinvisibleTag ). Parameters: info - the contents of this attribute. It does notinclude attribute_name_index orattribute_length . |
ParameterAnnotationsAttribute | public ParameterAnnotationsAttribute(ConstPool cp, String attrname)(Code) | | Constructs an empty
Runtime(In)VisisbleParameterAnnotations_attribute .
A new annotation can be later added to the created attribute
by setAnnotations() .
Parameters: cp - constant pool Parameters: attrname - attribute name (visibleTag orinvisibleTag ). See Also: ParameterAnnotationsAttribute.setAnnotations(Annotation[][]) |
getAnnotations | public Annotation[][] getAnnotations()(Code) | | Parses the annotations and returns a data structure representing
that parsed annotations. Note that changes of the node values of the
returned tree are not reflected on the annotations represented by
this object unless the tree is copied back to this object by
setAnnotations() .
Each element of the returned array represents an array ofannotations that are associated with each method parameter. See Also: ParameterAnnotationsAttribute.setAnnotations(Annotation[][]) |
numParameters | public int numParameters()(Code) | | Returns num_parameters .
|
setAnnotations | public void setAnnotations(Annotation[][] params)(Code) | | Changes the annotations represented by this object according to
the given array of Annotation objects.
Parameters: params - the data structure representing thenew annotations. Every element of this arrayis an array of Annotation andit represens annotations of each method parameter. |
|
|