Package javassist.bytecode.annotation
Class TypeAnnotationsWriter
- java.lang.Object
-
- javassist.bytecode.annotation.AnnotationsWriter
-
- javassist.bytecode.annotation.TypeAnnotationsWriter
-
public class TypeAnnotationsWriter extends AnnotationsWriter
A convenience class for constructing a..TypeAnnotations_attribute
. See the source code of theTypeAnnotationsAttribute
class.- Since:
- 3.19
-
-
Constructor Summary
Constructors Constructor Description TypeAnnotationsWriter(java.io.OutputStream os, ConstPool cp)
Constructs with the given output stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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 Detail
-
TypeAnnotationsWriter
public TypeAnnotationsWriter(java.io.OutputStream os, ConstPool cp)
Constructs with the given output stream.- Parameters:
os
- the output stream.cp
- the constant pool.
-
-
Method Detail
-
numAnnotations
public void numAnnotations(int num) throws java.io.IOException
Writesnum_annotations
inRuntime(In)VisibleTypeAnnotations_attribute
. It must be followed bynum
instances oftype_annotation
.- Overrides:
numAnnotations
in classAnnotationsWriter
- Throws:
java.io.IOException
-
typeParameterTarget
public void typeParameterTarget(int targetType, int typeParameterIndex) throws java.io.IOException
Writestarget_type
andtype_parameter_target
oftarget_info
union.- Throws:
java.io.IOException
-
supertypeTarget
public void supertypeTarget(int supertypeIndex) throws java.io.IOException
Writestarget_type
andsupertype_target
oftarget_info
union.- Throws:
java.io.IOException
-
typeParameterBoundTarget
public void typeParameterBoundTarget(int targetType, int typeParameterIndex, int boundIndex) throws java.io.IOException
Writestarget_type
andtype_parameter_bound_target
oftarget_info
union.- Throws:
java.io.IOException
-
emptyTarget
public void emptyTarget(int targetType) throws java.io.IOException
Writestarget_type
andempty_target
oftarget_info
union.- Throws:
java.io.IOException
-
formalParameterTarget
public void formalParameterTarget(int formalParameterIndex) throws java.io.IOException
Writestarget_type
andtype_parameter_target
oftarget_info
union.- Throws:
java.io.IOException
-
throwsTarget
public void throwsTarget(int throwsTypeIndex) throws java.io.IOException
Writestarget_type
andthrows_target
oftarget_info
union.- Throws:
java.io.IOException
-
localVarTarget
public void localVarTarget(int targetType, int tableLength) throws java.io.IOException
Writestarget_type
andlocalvar_target
oftarget_info
union. It must be followed bytableLength
calls tolocalVarTargetTable
.- Throws:
java.io.IOException
-
localVarTargetTable
public void localVarTargetTable(int startPc, int length, int index) throws java.io.IOException
Writes an element oftable[]
oflocalvar_target
oftarget_info
union.- Throws:
java.io.IOException
-
catchTarget
public void catchTarget(int exceptionTableIndex) throws java.io.IOException
Writestarget_type
andcatch_target
oftarget_info
union.- Throws:
java.io.IOException
-
offsetTarget
public void offsetTarget(int targetType, int offset) throws java.io.IOException
Writestarget_type
andoffset_target
oftarget_info
union.- Throws:
java.io.IOException
-
typeArgumentTarget
public void typeArgumentTarget(int targetType, int offset, int type_argument_index) throws java.io.IOException
Writestarget_type
andtype_argument_target
oftarget_info
union.- Throws:
java.io.IOException
-
typePath
public void typePath(int pathLength) throws java.io.IOException
Writespath_length
oftype_path
.- Throws:
java.io.IOException
-
typePathPath
public void typePathPath(int typePathKind, int typeArgumentIndex) throws java.io.IOException
Writes an element ofpath[]
oftype_path
.- Throws:
java.io.IOException
-
-