How to generate case classes in scala based on information kept in 100s of java classes? Basically, I need this for writing a wrapper for a java library.
Is it even possible? I have a feeling that no. In that case what is the best alternative?
How to generate case classes in scala based on information kept in 100s of java classes? Basically, I need this for writing a wrapper for a java library.
Is it even possible? I have a feeling that no. In that case what is the best alternative?
It is totally doable. Some ideas:
Of course you can. You can generate them before compilation. You will want to introspect the Java classes (maybe using the reflection API) and then generate corresponding Scala source code. You can either generate it once and copy to the repository or create a generator and use it in the building tool, e.g. in SBT.
You can generate the code either by hand (by concatenating the strings) or by a library like TreeHugger