Top Description Fields Constructors Methods
javassist.bytecode

public Class ParameterAnnotationsAttribute

extends AttributeInfo
Class Inheritance
Imports
java.io.ByteArrayOutputStream, .DataInputStream, .IOException, java.util.HashMap, .Map, javassist.bytecode.AnnotationsAttribute.Copier, .AnnotationsAttribute.Parser, .AnnotationsAttribute.Renamer, javassist.bytecode.annotation.Annotation, .AnnotationsWriter

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

Modifier and TypeField and Description
public static final String
invisibleTag

The name of the RuntimeInvisibleParameterAnnotations attribute.

public static final String
visibleTag

The name of the RuntimeVisibleParameterAnnotations attribute.

Inherited from javassist.bytecode.AttributeInfo:
constPoolinfoname

Constructor Summary

AccessConstructor and Description
public
ParameterAnnotationsAttribute(ConstPool
constant pool
cp
,
String
attribute name (visibleTag or invisibleTag).
attrname
,
byte[]
the contents of this attribute. It does not include attribute_name_index or attribute_length.
info
)

Constructs a Runtime(In)VisibleParameterAnnotations_attribute.

public
ParameterAnnotationsAttribute(ConstPool
constant pool
cp
,
String
attribute name (visibleTag or invisibleTag).
attrname
)

Constructs an empty Runtime(In)VisibleParameterAnnotations_attribute.

pack-priv
ParameterAnnotationsAttribute(ConstPool cp, int
the attribute name.
n
,
DataInputStream in)

Method Summary

Modifier and TypeMethod and Description
public AttributeInfo
copy(ConstPool
the constant pool table used by the new copy.
newCp
,
Map<String, String>
pairs of replaced and substituted class names.
classnames
)

Overrides javassist.bytecode.AttributeInfo.copy.

Copies this attribute and returns a new copy.

public Annotation[][]

Returns:

Each element of the returned array represents an array of annotations that are associated with each method parameter.
getAnnotations
()

Parses the annotations and returns a data structure representing that parsed annotations.

pack-priv void
public int
numParameters()

Returns num_parameters.

pack-priv void
renameClass(String
a JVM class name.
oldname
,
String
a JVM class name.
newname
)

Overrides javassist.bytecode.AttributeInfo.renameClass.

pack-priv void
public void
setAnnotations(Annotation[][]
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.
params
)

Changes the annotations represented by this object according to the given array of Annotation objects.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of this object.

Inherited from javassist.bytecode.AttributeInfo:
copyAllgetgetConstPoolgetLengthgetNamegetRefClasseslengthlookupreadremoverenameClassrenameClasssetwritewriteAll

Field Detail

invisibleTagback to summary
public static final String invisibleTag

The name of the RuntimeInvisibleParameterAnnotations attribute.

visibleTagback to summary
public static final String visibleTag

The name of the RuntimeVisibleParameterAnnotations attribute.

Constructor Detail

ParameterAnnotationsAttributeback to summary
public ParameterAnnotationsAttribute(ConstPool cp, String attrname, byte[] info)

Constructs a Runtime(In)VisibleParameterAnnotations_attribute.

Parameters
cp:ConstPool

constant pool

attrname:String

attribute name (visibleTag or invisibleTag).

info:byte[]

the contents of this attribute. It does not include attribute_name_index or attribute_length.

ParameterAnnotationsAttributeback to summary
public ParameterAnnotationsAttribute(ConstPool cp, String attrname)

Constructs an empty Runtime(In)VisibleParameterAnnotations_attribute. A new annotation can be later added to the created attribute by setAnnotations().

Parameters
cp:ConstPool

constant pool

attrname:String

attribute name (visibleTag or invisibleTag).

See Also
setAnnotations(Annotation[][])
ParameterAnnotationsAttributeback to summary
pack-priv ParameterAnnotationsAttribute(ConstPool cp, int n, DataInputStream in) throws IOException
Parameters
n:int

the attribute name.

Method Detail

copyback to summary
public AttributeInfo copy(ConstPool newCp, Map<String, String> classnames)

Overrides javassist.bytecode.AttributeInfo.copy.

Copies this attribute and returns a new copy.

Parameters
newCp:ConstPool

Doc from javassist.bytecode.AttributeInfo.copy.

the constant pool table used by the new copy.

classnames:Map<String, String>

Doc from javassist.bytecode.AttributeInfo.copy.

pairs of replaced and substituted class names.

Annotations
@Override
getAnnotationsback to summary
public Annotation[][] getAnnotations()

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().

Returns:Annotation[][]

Each element of the returned array represents an array of annotations that are associated with each method parameter.

See Also
setAnnotations(Annotation[][])
getRefClassesback to summary
pack-priv void getRefClasses(Map<String, String> classnames)

Overrides javassist.bytecode.AttributeInfo.getRefClasses.

Annotations
@Override
numParametersback to summary
public int numParameters()

Returns num_parameters.

renameClassback to summary
pack-priv void renameClass(String oldname, String newname)

Overrides javassist.bytecode.AttributeInfo.renameClass.

Parameters
oldname:String

a JVM class name.

newname:String

a JVM class name.

Annotations
@Override
renameClassback to summary
pack-priv void renameClass(Map<String, String> classnames)

Overrides javassist.bytecode.AttributeInfo.renameClass.

Annotations
@Override
setAnnotationsback to summary
public void setAnnotations(Annotation[][] params)

Changes the annotations represented by this object according to the given array of Annotation objects.

Parameters
params:Annotation[][]

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.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this object.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@Override