java.lang.Object
io.github.sugarcubes.cloner.enhancement.ClassInfo

public final class ClassInfo extends Object
What the enhancement needs to know about a class: its kind, superclass, interfaces and whether it already has a copy constructor.
  • Constructor Details

    • ClassInfo

      public ClassInfo(String name, int access, String superName, List<String> interfaces, boolean copyConstructor, boolean serialVersionUid)
      Constructor.
      Parameters:
      name - internal name
      access - access flags of the class
      superName - internal name of the superclass, null for Object
      interfaces - internal names of the interfaces
      copyConstructor - whether the class has a copy constructor
      serialVersionUid - whether the class declares serialVersionUID
    • ClassInfo

      public ClassInfo(String name, int access, String superName, List<String> interfaces, boolean copyConstructor, boolean serialVersionUid, LanguageInfo language)
      Constructor.
      Parameters:
      name - internal name
      access - access flags of the class
      superName - internal name of the superclass, null for Object
      interfaces - internal names of the interfaces
      copyConstructor - whether the class has a copy constructor
      serialVersionUid - whether the class declares serialVersionUID
      language - what the class file tells about Kotlin and Scala
  • Method Details

    • read

      public static ClassInfo read(byte[] bytes, BytecodeBackend backend)
      Reads the information from a class file.
      Parameters:
      bytes - class file
      backend - engine which reads it
      Returns:
      class information
    • of

      public static ClassInfo of(ClassStructure structure)
      Returns the information of the structure of a class file.
      Parameters:
      structure - structure of the class file
      Returns:
      class information
    • getName

      public String getName()
      Returns the internal name.
      Returns:
      internal name
    • getAccess

      public int getAccess()
      Returns the access flags.
      Returns:
      access flags
    • getSuperName

      public String getSuperName()
      Returns the internal name of the superclass.
      Returns:
      internal name or null for Object
    • getInterfaces

      public List<String> getInterfaces()
      Returns the internal names of the interfaces.
      Returns:
      internal names
    • hasCopyConstructor

      public boolean hasCopyConstructor()
      Tells whether the class has a copy constructor.
      Returns:
      true if it has
    • declaresSerialVersionUid

      public boolean declaresSerialVersionUid()
      Tells whether the class declares serialVersionUID.
      Returns:
      true if it declares
    • getLanguage

      public LanguageInfo getLanguage()
      Returns what the class file tells about Kotlin and Scala.
      Returns:
      language information, LanguageInfo.NONE for other classes
    • is

      public boolean is(int flag)
      Tells whether the flag is set.
      Parameters:
      flag - access flag
      Returns:
      true if set