I've got Xml files. They contain the structure that should be parsed in special kind of objects - with certain methods, fields and so on. Those Xml files should be provided in runtime for working application. So I need to parse it and generate java code that can be used in the application (loaded in runtime).
For parsing Xml I am using groovy. The application itself is not Groovy application but purely Java it's just that Xml processing is easier there.
But my question is - how should I generate Java classes? I can load them via classloader, but I need to generate .class
files for him.
Should I generate .java
classes and compile them (in a separate process) or should I create .class
files directly? What libraries should I use for that?