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.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
invisibleTag
The name of the
RuntimeInvisibleParameterAnnotations
attribute. |
static java.lang.String |
visibleTag
The name of the
RuntimeVisibleParameterAnnotations
attribute. |
constPool, info, name
Constructor and Description |
---|
ParameterAnnotationsAttribute(ConstPool cp,
int n,
java.io.DataInputStream in) |
ParameterAnnotationsAttribute(ConstPool cp,
java.lang.String attrname)
Constructs an empty
Runtime(In)VisibleParameterAnnotations_attribute . |
ParameterAnnotationsAttribute(ConstPool cp,
java.lang.String attrname,
byte[] info)
Constructs
a
Runtime(In)VisibleParameterAnnotations_attribute . |
Modifier and Type | Method and Description |
---|---|
AttributeInfo |
copy(ConstPool newCp,
java.util.Map classnames)
Copies this attribute and returns a new copy.
|
Annotation[][] |
getAnnotations()
Parses the annotations and returns a data structure representing
that parsed annotations.
|
(package private) void |
getRefClasses(java.util.Map classnames) |
int |
numParameters()
Returns
num_parameters . |
(package private) void |
renameClass(java.util.Map classnames) |
(package private) void |
renameClass(java.lang.String oldname,
java.lang.String newname) |
void |
setAnnotations(Annotation[][] params)
Changes the annotations represented by this object according to
the given array of
Annotation objects. |
java.lang.String |
toString()
Returns a string representation of this object.
|
copyAll, get, getConstPool, getLength, getName, getRefClasses, length, lookup, read, remove, renameClass, renameClass, set, write, writeAll
public static final java.lang.String visibleTag
RuntimeVisibleParameterAnnotations
attribute.public static final java.lang.String invisibleTag
RuntimeInvisibleParameterAnnotations
attribute.public ParameterAnnotationsAttribute(ConstPool cp, java.lang.String attrname, byte[] info)
Runtime(In)VisibleParameterAnnotations_attribute
.cp
- constant poolattrname
- attribute name (visibleTag
or
invisibleTag
).info
- the contents of this attribute. It does not
include attribute_name_index
or
attribute_length
.public ParameterAnnotationsAttribute(ConstPool cp, java.lang.String attrname)
Runtime(In)VisibleParameterAnnotations_attribute
.
A new annotation can be later added to the created attribute
by setAnnotations()
.cp
- constant poolattrname
- attribute name (visibleTag
or
invisibleTag
).setAnnotations(Annotation[][])
ParameterAnnotationsAttribute(ConstPool cp, int n, java.io.DataInputStream in) throws java.io.IOException
n
- the attribute name.java.io.IOException
public int numParameters()
num_parameters
.public AttributeInfo copy(ConstPool newCp, java.util.Map classnames)
copy
in class AttributeInfo
newCp
- the constant pool table used by the new copy.classnames
- pairs of replaced and substituted
class names.public Annotation[][] getAnnotations()
setAnnotations()
.setAnnotations(Annotation[][])
public void setAnnotations(Annotation[][] params)
Annotation
objects.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.void renameClass(java.lang.String oldname, java.lang.String newname)
renameClass
in class AttributeInfo
oldname
- a JVM class name.newname
- a JVM class name.void renameClass(java.util.Map classnames)
renameClass
in class AttributeInfo
void getRefClasses(java.util.Map classnames)
getRefClasses
in class AttributeInfo
public java.lang.String toString()
toString
in class java.lang.Object