Package javassist.bytecode
Class TypeAnnotationsAttribute
java.lang.Object
javassist.bytecode.AttributeInfo
javassist.bytecode.TypeAnnotationsAttribute
A class representing
RuntimeVisibleTypeAnnotations
attribute and
RuntimeInvisibleTypeAnnotations
attribute.- Since:
- 3.19
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
(package private) static class
(package private) static class
(package private) static class
(package private) static class
To visit each elements of the type annotation attribute, callannotationArray()
. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The name of theRuntimeInvisibleTypeAnnotations
attribute.static final String
The name of theRuntimeVisibleTypeAnnotations
attribute.Fields inherited from class javassist.bytecode.AttributeInfo
constPool, info, name
-
Constructor Summary
ConstructorsConstructorDescriptionTypeAnnotationsAttribute
(ConstPool cp, int n, DataInputStream in) TypeAnnotationsAttribute
(ConstPool cp, String attrname, byte[] info) Constructs aRuntime(In)VisibleTypeAnnotations_attribute
. -
Method Summary
Modifier and TypeMethodDescriptionCopies this attribute and returns a new copy.(package private) void
getRefClasses
(Map<String, String> classnames) int
Returnsnum_annotations
.(package private) void
renameClass
(String oldname, String newname) (package private) void
renameClass
(Map<String, String> classnames) Methods inherited from class javassist.bytecode.AttributeInfo
copyAll, get, getConstPool, getLength, getName, getRefClasses, length, lookup, read, remove, renameClass, renameClass, set, write, writeAll
-
Field Details
-
visibleTag
The name of theRuntimeVisibleTypeAnnotations
attribute.- See Also:
-
invisibleTag
The name of theRuntimeInvisibleTypeAnnotations
attribute.- See Also:
-
-
Constructor Details
-
TypeAnnotationsAttribute
Constructs aRuntime(In)VisibleTypeAnnotations_attribute
.- Parameters:
cp
- constant poolattrname
- attribute name (visibleTag
orinvisibleTag
).info
- the contents of this attribute. It does not includeattribute_name_index
orattribute_length
.
-
TypeAnnotationsAttribute
TypeAnnotationsAttribute(ConstPool cp, int n, DataInputStream in) throws IOException - Parameters:
n
- the attribute name.- Throws:
IOException
-
-
Method Details
-
numAnnotations
public int numAnnotations()Returnsnum_annotations
. -
copy
Copies this attribute and returns a new copy.- Overrides:
copy
in classAttributeInfo
- Parameters:
newCp
- the constant pool table used by the new copy.classnames
- pairs of replaced and substituted class names.
-
renameClass
- Overrides:
renameClass
in classAttributeInfo
- Parameters:
oldname
- a JVM class name.newname
- a JVM class name.
-
renameClass
- Overrides:
renameClass
in classAttributeInfo
-
getRefClasses
- Overrides:
getRefClasses
in classAttributeInfo
-