java.lang.Object
io.github.sugarcubes.cloner.enhancement.ClassInfo
What the enhancement needs to know about a class: its kind, superclass, interfaces and whether it already has a copy
constructor.
-
Constructor Summary
ConstructorsConstructorDescriptionClassInfo(String name, int access, String superName, List<String> interfaces, boolean copyConstructor, boolean serialVersionUid) Constructor.ClassInfo(String name, int access, String superName, List<String> interfaces, boolean copyConstructor, boolean serialVersionUid, LanguageInfo language) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTells whether the class declaresserialVersionUID.intReturns the access flags.Returns the internal names of the interfaces.Returns what the class file tells about Kotlin and Scala.getName()Returns the internal name.Returns the internal name of the superclass.booleanTells whether the class has a copy constructor.booleanis(int flag) Tells whether the flag is set.static ClassInfoof(ClassStructure structure) Returns the information of the structure of a class file.static ClassInforead(byte[] bytes, BytecodeBackend backend) Reads the information from a class file.
-
Constructor Details
-
ClassInfo
public ClassInfo(String name, int access, String superName, List<String> interfaces, boolean copyConstructor, boolean serialVersionUid) Constructor.- Parameters:
name- internal nameaccess- access flags of the classsuperName- internal name of the superclass,nullforObjectinterfaces- internal names of the interfacescopyConstructor- whether the class has a copy constructorserialVersionUid- whether the class declaresserialVersionUID
-
ClassInfo
public ClassInfo(String name, int access, String superName, List<String> interfaces, boolean copyConstructor, boolean serialVersionUid, LanguageInfo language) Constructor.- Parameters:
name- internal nameaccess- access flags of the classsuperName- internal name of the superclass,nullforObjectinterfaces- internal names of the interfacescopyConstructor- whether the class has a copy constructorserialVersionUid- whether the class declaresserialVersionUIDlanguage- what the class file tells about Kotlin and Scala
-
-
Method Details
-
read
Reads the information from a class file.- Parameters:
bytes- class filebackend- engine which reads it- Returns:
- class information
-
of
Returns the information of the structure of a class file.- Parameters:
structure- structure of the class file- Returns:
- class information
-
getName
Returns the internal name.- Returns:
- internal name
-
getAccess
public int getAccess()Returns the access flags.- Returns:
- access flags
-
getSuperName
Returns the internal name of the superclass.- Returns:
- internal name or
nullforObject
-
getInterfaces
Returns the internal names of the interfaces.- Returns:
- internal names
-
hasCopyConstructor
public boolean hasCopyConstructor()Tells whether the class has a copy constructor.- Returns:
trueif it has
-
declaresSerialVersionUid
public boolean declaresSerialVersionUid()Tells whether the class declaresserialVersionUID.- Returns:
trueif it declares
-
getLanguage
Returns what the class file tells about Kotlin and Scala.- Returns:
- language information,
LanguageInfo.NONEfor other classes
-
is
public boolean is(int flag) Tells whether the flag is set.- Parameters:
flag- access flag- Returns:
trueif set
-