Class ClassFile

java.lang.Object
org.codehaus.janino.util.ClassFile
All Implemented Interfaces:
Annotatable

public class ClassFile extends Object implements Annotatable
An object that implements the Java "class file" format.

ClassFile(InputStream) reads bytecode from an InputStream and creates a ClassFile object from it.

store(OutputStream) generates JVM bytecode which is suitable for being processed by a Java virtual machine, and writes it to an OutputStream.

  • Field Details

    • CLASS_FILE_MAGIC

      private static final int CLASS_FILE_MAGIC
      See Also:
    • MAJOR_VERSION_JDK_1_1

      public static final short MAJOR_VERSION_JDK_1_1
      Major version number of a class file that was generated by a Java 1.1-compliant compiler.
      See Also:
    • MINOR_VERSION_JDK_1_1

      public static final short MINOR_VERSION_JDK_1_1
      Minor version number of a class file that was generated by a Java 1.1-compliant compiler.
      See Also:
    • MAJOR_VERSION_JDK_1_2

      public static final short MAJOR_VERSION_JDK_1_2
      Major version number of a class file that was generated by a Java 1.2-compliant compiler.
      See Also:
    • MINOR_VERSION_JDK_1_2

      public static final short MINOR_VERSION_JDK_1_2
      Minor version number of a class file that was generated by a Java 1.2-compliant compiler.
      See Also:
    • MAJOR_VERSION_JDK_1_3

      public static final short MAJOR_VERSION_JDK_1_3
      Major version number of a class file that was generated by a Java 1.3-compliant compiler.
      See Also:
    • MINOR_VERSION_JDK_1_3

      public static final short MINOR_VERSION_JDK_1_3
      Minor version number of a class file that was generated by a Java 1.3-compliant compiler.
      See Also:
    • MAJOR_VERSION_JDK_1_4

      public static final short MAJOR_VERSION_JDK_1_4
      Major version number of a class file that was generated by a Java 1.4-compliant compiler.
      See Also:
    • MINOR_VERSION_JDK_1_4

      public static final short MINOR_VERSION_JDK_1_4
      Minor version number of a class file that was generated by a Java 1.4-compliant compiler.
      See Also:
    • MAJOR_VERSION_JDK_1_5

      public static final short MAJOR_VERSION_JDK_1_5
      Major version number of a class file that was generated by a Java 1.5-compliant compiler.
      See Also:
    • MINOR_VERSION_JDK_1_5

      public static final short MINOR_VERSION_JDK_1_5
      Minor version number of a class file that was generated by a Java 1.5-compliant compiler.
      See Also:
    • MAJOR_VERSION_JDK_1_6

      public static final short MAJOR_VERSION_JDK_1_6
      Major version number of a class file that was generated by a Java 1.6-compliant compiler.
      See Also:
    • MINOR_VERSION_JDK_1_6

      public static final short MINOR_VERSION_JDK_1_6
      Minor version number of a class file that was generated by a Java 1.6-compliant compiler.
      See Also:
    • MAJOR_VERSION_JDK_1_7

      public static final short MAJOR_VERSION_JDK_1_7
      Major version number of a class file that was generated by a Java 1.7-compliant compiler.
      See Also:
    • MINOR_VERSION_JDK_1_7

      public static final short MINOR_VERSION_JDK_1_7
      Minor version number of a class file that was generated by a Java 1.7-compliant compiler.
      See Also:
    • MAJOR_VERSION_JDK_1_8

      public static final short MAJOR_VERSION_JDK_1_8
      Major version number of a class file that was generated by a Java 1.8-compliant compiler.
      See Also:
    • MINOR_VERSION_JDK_1_8

      public static final short MINOR_VERSION_JDK_1_8
      Minor version number of a class file that was generated by a Java 1.8-compliant compiler.
      See Also:
    • MAJOR_VERSION_JDK_1_9

      public static final short MAJOR_VERSION_JDK_1_9
      Major version number of a class file that was generated by a Java 1.9-compliant compiler.
      See Also:
    • MINOR_VERSION_JDK_1_9

      public static final short MINOR_VERSION_JDK_1_9
      Minor version number of a class file that was generated by a Java 1.9-compliant compiler.
      See Also:
    • MAJOR_VERSION_JDK_1_10

      public static final short MAJOR_VERSION_JDK_1_10
      Major version number of a class file that was generated by a Java 1.10-compliant compiler.
      See Also:
    • MINOR_VERSION_JDK_1_10

      public static final short MINOR_VERSION_JDK_1_10
      Minor version number of a class file that was generated by a Java 1.10-compliant compiler.
      See Also:
    • MAJOR_VERSION_JDK_1_11

      public static final short MAJOR_VERSION_JDK_1_11
      Major version number of a class file that was generated by a Java 1.11-compliant compiler.
      See Also:
    • MINOR_VERSION_JDK_1_11

      public static final short MINOR_VERSION_JDK_1_11
      Minor version number of a class file that was generated by a Java 1.11-compliant compiler.
      See Also:
    • MAJOR_VERSION_JDK_1_12

      public static final short MAJOR_VERSION_JDK_1_12
      Major version number of a class file that was generated by a Java 1.12-compliant compiler.
      See Also:
    • MINOR_VERSION_JDK_1_12

      public static final short MINOR_VERSION_JDK_1_12
      Minor version number of a class file that was generated by a Java 1.12-compliant compiler.
      See Also:
    • majorVersion

      private short majorVersion
    • minorVersion

      private short minorVersion
    • constantPool

      private final List<ClassFile.ConstantPoolInfo> constantPool
    • accessFlags

      public final short accessFlags
      The access flags of the class.
      See Also:
    • thisClass

      public final short thisClass
      The constant pool index of the ClassFile.ConstantClassInfo that describes this class.
    • superclass

      public final short superclass
      The constant pool index of the ClassFile.ConstantClassInfo that describes the superclass of this class. Zero for class Object, Object for interfaces.
      See Also:
      • "JVMS11 4.1, The ClassFile Structure"
    • interfaces

      public final short[] interfaces
      The constant pool indexes of ClassFile.ConstantClassInfo which describe the interfaces that this class implements, resp. that this interface extends.
    • fieldInfos

      public final List<ClassFile.FieldInfo> fieldInfos
      The ClassFile.FieldInfos of the field members of this class or interface.
    • methodInfos

      public final List<ClassFile.MethodInfo> methodInfos
      The ClassFile.MethodInfos of the methods of this class or interface.
    • attributes

      private final List<ClassFile.AttributeInfo> attributes
      The ClassFile.AttributeInfos of the attributes of this class or interface.
    • constantPoolMap

      private final Map<ClassFile.ConstantPoolInfo,Short> constantPoolMap
  • Constructor Details

  • Method Details