Module io.github.sugarcubes.cloner
Class CopyConstructorEnhancer
java.lang.Object
io.github.sugarcubes.cloner.enhancement.CopyConstructorEnhancer
Adds a copy constructor to a class file, see
io.github.sugarcubes.cloner.generation.CopyConstructors for its
contract.
The constructor is synthetic, private in final classes and protected in the others: constructors of subclasses
call it. A protected constructor would change the serial version computed for a serializable class without
serialVersionUID, so such a class gets serialVersionUID with the value computed for the original
class.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classResult of enhancing a class file.static enumResult of enhancing a class file. -
Method Summary
Modifier and TypeMethodDescriptionenhance(byte[] bytes, ClassHierarchy hierarchy, BytecodeBackend backend) Adds the copy constructor to the class file if the class matches the masks and can get it.
-
Method Details
-
enhance
public static CopyConstructorEnhancer.Result enhance(byte[] bytes, ClassHierarchy hierarchy, BytecodeBackend backend) Adds the copy constructor to the class file if the class matches the masks and can get it.- Parameters:
bytes- class filehierarchy- classes which are enhanced and their superclassesbackend- bytecode engine- Returns:
- result
-