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 the TypeAnnotationsAttribute class.
Since:
3.19
  • Constructor Details

    • TypeAnnotationsWriter

      public TypeAnnotationsWriter(OutputStream os, ConstPool cp)
      Constructs with the given output stream.
      Parameters:
      os - the output stream.
      cp - the constant pool.
  • Method Details

    • numAnnotations

      public void numAnnotations(int num) throws IOException
      Writes num_annotations in Runtime(In)VisibleTypeAnnotations_attribute. It must be followed by num instances of type_annotation.
      Overrides:
      numAnnotations in class AnnotationsWriter
      Throws:
      IOException
    • typeParameterTarget

      public void typeParameterTarget(int targetType, int typeParameterIndex) throws IOException
      Writes target_type and type_parameter_target of target_info union.
      Throws:
      IOException
    • supertypeTarget

      public void supertypeTarget(int supertypeIndex) throws IOException
      Writes target_type and supertype_target of target_info union.
      Throws:
      IOException
    • typeParameterBoundTarget

      public void typeParameterBoundTarget(int targetType, int typeParameterIndex, int boundIndex) throws IOException
      Writes target_type and type_parameter_bound_target of target_info union.
      Throws:
      IOException
    • emptyTarget

      public void emptyTarget(int targetType) throws IOException
      Writes target_type and empty_target of target_info union.
      Throws:
      IOException
    • formalParameterTarget

      public void formalParameterTarget(int formalParameterIndex) throws IOException
      Writes target_type and type_parameter_target of target_info union.
      Throws:
      IOException
    • throwsTarget

      public void throwsTarget(int throwsTypeIndex) throws IOException
      Writes target_type and throws_target of target_info union.
      Throws:
      IOException
    • localVarTarget

      public void localVarTarget(int targetType, int tableLength) throws IOException
      Writes target_type and localvar_target of target_info union. It must be followed by tableLength calls to localVarTargetTable.
      Throws:
      IOException
    • localVarTargetTable

      public void localVarTargetTable(int startPc, int length, int index) throws IOException
      Writes an element of table[] of localvar_target of target_info union.
      Throws:
      IOException
    • catchTarget

      public void catchTarget(int exceptionTableIndex) throws IOException
      Writes target_type and catch_target of target_info union.
      Throws:
      IOException
    • offsetTarget

      public void offsetTarget(int targetType, int offset) throws IOException
      Writes target_type and offset_target of target_info union.
      Throws:
      IOException
    • typeArgumentTarget

      public void typeArgumentTarget(int targetType, int offset, int type_argument_index) throws IOException
      Writes target_type and type_argument_target of target_info union.
      Throws:
      IOException
    • typePath

      public void typePath(int pathLength) throws IOException
      Writes path_length of type_path.
      Throws:
      IOException
    • typePathPath

      public void typePathPath(int typePathKind, int typeArgumentIndex) throws IOException
      Writes an element of path[] of type_path.
      Throws:
      IOException