Package javassist.bytecode.annotation
Class TypeAnnotationsWriter
java.lang.Object
javassist.bytecode.annotation.AnnotationsWriter
javassist.bytecode.annotation.TypeAnnotationsWriter
A convenience class for constructing a
..TypeAnnotations_attribute
.
See the source code of the TypeAnnotationsAttribute
class.- Since:
- 3.19
-
Constructor Summary
ConstructorDescriptionConstructs with the given output stream. -
Method Summary
Modifier and TypeMethodDescriptionvoid
catchTarget
(int exceptionTableIndex) Writestarget_type
andcatch_target
oftarget_info
union.void
emptyTarget
(int targetType) Writestarget_type
andempty_target
oftarget_info
union.void
formalParameterTarget
(int formalParameterIndex) Writestarget_type
andtype_parameter_target
oftarget_info
union.void
localVarTarget
(int targetType, int tableLength) Writestarget_type
andlocalvar_target
oftarget_info
union.void
localVarTargetTable
(int startPc, int length, int index) Writes an element oftable[]
oflocalvar_target
oftarget_info
union.void
numAnnotations
(int num) Writesnum_annotations
inRuntime(In)VisibleTypeAnnotations_attribute
.void
offsetTarget
(int targetType, int offset) Writestarget_type
andoffset_target
oftarget_info
union.void
supertypeTarget
(int supertypeIndex) Writestarget_type
andsupertype_target
oftarget_info
union.void
throwsTarget
(int throwsTypeIndex) Writestarget_type
andthrows_target
oftarget_info
union.void
typeArgumentTarget
(int targetType, int offset, int type_argument_index) Writestarget_type
andtype_argument_target
oftarget_info
union.void
typeParameterBoundTarget
(int targetType, int typeParameterIndex, int boundIndex) Writestarget_type
andtype_parameter_bound_target
oftarget_info
union.void
typeParameterTarget
(int targetType, int typeParameterIndex) Writestarget_type
andtype_parameter_target
oftarget_info
union.void
typePath
(int pathLength) Writespath_length
oftype_path
.void
typePathPath
(int typePathKind, int typeArgumentIndex) Writes an element ofpath[]
oftype_path
.Methods inherited from class javassist.bytecode.annotation.AnnotationsWriter
annotation, annotation, annotationValue, arrayValue, classInfoIndex, classInfoIndex, close, constValueIndex, constValueIndex, constValueIndex, constValueIndex, constValueIndex, constValueIndex, constValueIndex, constValueIndex, constValueIndex, constValueIndex, enumConstValue, enumConstValue, getConstPool, memberValuePair, memberValuePair, numParameters
-
Constructor Details
-
TypeAnnotationsWriter
Constructs with the given output stream.- Parameters:
os
- the output stream.cp
- the constant pool.
-
-
Method Details
-
numAnnotations
Writesnum_annotations
inRuntime(In)VisibleTypeAnnotations_attribute
. It must be followed bynum
instances oftype_annotation
.- Overrides:
numAnnotations
in classAnnotationsWriter
- Throws:
IOException
-
typeParameterTarget
Writestarget_type
andtype_parameter_target
oftarget_info
union.- Throws:
IOException
-
supertypeTarget
Writestarget_type
andsupertype_target
oftarget_info
union.- Throws:
IOException
-
typeParameterBoundTarget
public void typeParameterBoundTarget(int targetType, int typeParameterIndex, int boundIndex) throws IOException Writestarget_type
andtype_parameter_bound_target
oftarget_info
union.- Throws:
IOException
-
emptyTarget
Writestarget_type
andempty_target
oftarget_info
union.- Throws:
IOException
-
formalParameterTarget
Writestarget_type
andtype_parameter_target
oftarget_info
union.- Throws:
IOException
-
throwsTarget
Writestarget_type
andthrows_target
oftarget_info
union.- Throws:
IOException
-
localVarTarget
Writestarget_type
andlocalvar_target
oftarget_info
union. It must be followed bytableLength
calls tolocalVarTargetTable
.- Throws:
IOException
-
localVarTargetTable
Writes an element oftable[]
oflocalvar_target
oftarget_info
union.- Throws:
IOException
-
catchTarget
Writestarget_type
andcatch_target
oftarget_info
union.- Throws:
IOException
-
offsetTarget
Writestarget_type
andoffset_target
oftarget_info
union.- Throws:
IOException
-
typeArgumentTarget
public void typeArgumentTarget(int targetType, int offset, int type_argument_index) throws IOException Writestarget_type
andtype_argument_target
oftarget_info
union.- Throws:
IOException
-
typePath
Writespath_length
oftype_path
.- Throws:
IOException
-
typePathPath
Writes an element ofpath[]
oftype_path
.- Throws:
IOException
-