AnnotationReader (Jython API documentation)
Date: 2024-08-18

org.python.core

## Class AnnotationReader

- java.lang.Object
- - org.objectweb.asm.ClassVisitor
  - - org.python.core.AnnotationReader

-     public class AnnotationReader
      extends org.objectweb.asm.ClassVisitor

  This class reads a classfile from a byte array and pulls out the value of the class annotation for APIVersion, which can then be retrieved by a call to getVersion(). Hopefully the use of ClassReader in this implementation is not too expensive. I suspect it is not since EmptyVisitor is just a bag of empty methods so shouldn't cost too much. If it turns out to cost too much, we will want to implement a special purpose ClassReader that only reads out the APIVersion annotation I think.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AnnotationReader(byte[] data)` Reads the classfile bytecode in data and to extract the version.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getFilename()`
    `long` | `getMTime()`
    `int` | `getVersion()`
    `org.objectweb.asm.AnnotationVisitor` | `visitAnnotation(java.lang.String desc, boolean visible)`

    - ### Methods inherited from class org.objectweb.asm.ClassVisitor

      `getDelegate, visit, visitAttribute, visitEnd, visitField, visitInnerClass, visitMethod, visitModule, visitNestHost, visitNestMember, visitOuterClass, visitPermittedSubclass, visitRecordComponent, visitSource, visitTypeAnnotation`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AnnotationReader

          public AnnotationReader(byte[] data)
                           throws java.io.IOException

      Reads the classfile bytecode in data and to extract the version.
      Throws:
        `java.io.IOException` - - if the classfile is malformed.

  - ### Method Detail

    - #### visitAnnotation

          public org.objectweb.asm.AnnotationVisitor visitAnnotation(java.lang.String desc,
                                                                     boolean visible)

      Overrides:
        `visitAnnotation` in class `org.objectweb.asm.ClassVisitor`

    - #### getVersion

          public int getVersion()

    - #### getMTime

          public long getMTime()

    - #### getFilename

          public java.lang.String getFilename()

Jython homepage