Hello, I'd like to copy the source code for functions defined in one class to a newly generated class in KotlinPoet. I'm a little new to annotation processing but understand why this might be a little problematic. I want to know if there's a better way than just somehow getting the file of the original class and reading from it, since that sounds super hacky.
The bigger picture is:
I'm trying to take functions in a class
Base
, which override from a superclass
Top
, and share them between several classes which extend different subclasses of
Top
that I can't edit. There are no interfaces in the heirarchy (can't use delegation) and I need to access protected properties, so an annotation processor seemed like the best option. Feel free to suggest better ones!