Interface ClassFile

All Superinterfaces:
HasAttribute
All Known Implementing Classes:
DirectClassFile

public interface ClassFile extends HasAttribute
Interface for things which purport to be class files or reasonable facsimiles thereof.

Note: The fields referred to in this documentation are of the ClassFile structure defined in vmspec-2 sec4.1.

  • Method Details

    • getMagic

      int getMagic()
      Gets the field magic.
      Returns:
      the value in question
    • getMinorVersion

      int getMinorVersion()
      Gets the field minor_version.
      Returns:
      the value in question
    • getMajorVersion

      int getMajorVersion()
      Gets the field major_version.
      Returns:
      the value in question
    • getAccessFlags

      int getAccessFlags()
      Gets the field access_flags.
      Returns:
      the value in question
    • getThisClass

      CstType getThisClass()
      Gets the field this_class, interpreted as a type constant.
      Returns:
      non-null; the value in question
    • getSuperclass

      CstType getSuperclass()
      Gets the field super_class, interpreted as a type constant if non-zero.
      Returns:
      null-ok; the value in question
    • getConstantPool

      ConstantPool getConstantPool()
      Gets the field constant_pool (along with constant_pool_count).
      Returns:
      non-null; the constant pool
    • getInterfaces

      TypeList getInterfaces()
      Gets the field interfaces (along with interfaces_count).
      Returns:
      non-null; the list of interfaces
    • getFields

      FieldList getFields()
      Gets the field fields (along with fields_count).
      Returns:
      non-null; the list of fields
    • getMethods

      MethodList getMethods()
      Gets the field methods (along with methods_count).
      Returns:
      non-null; the list of fields
    • getAttributes

      AttributeList getAttributes()
      Gets the field attributes (along with attributes_count).
      Specified by:
      getAttributes in interface HasAttribute
      Returns:
      non-null; the list of attributes
    • getBootstrapMethods

      BootstrapMethodsList getBootstrapMethods()
      Gets the bootstrap method attributes.
      Returns:
      non-null; the list of bootstrap methods
    • getSourceFile

      CstString getSourceFile()
      Gets the name out of the SourceFile attribute of this file, if any. This is a convenient shorthand for scrounging around the class's attributes.
      Returns:
      non-null; the constant pool