How would I implement methods that I copy from an interface in a CtClass,
to a class I have as a ClassFile.
ClassFile seems only to allow to add methods using a MethodInfo, so how is the body added?
Basically I want to implement an interface on a class, and if that class has some getter or setter methods of the interface missing, then I want to add those methods in using the definition in the interface, and providing bodies that interact with a superclass for values.
I again recommend you to use ClassPool and CtClass, CtMethod, ... They provide a number of utility methods
for creating a getter method etc.
Otherwise, you must construct a MethodInfo by hand
(you must specify a sequence Java bytecode as a body).
Bytecode class would help you.