At the time of building (compiling) my project, I need to create code for the java class. The generated java class is a java bean class with a set of getters and setters. During build I get the class name and variable names. So what I need to do is dynamically generate a java bean from the information I have.
eg. At compile time, I get the following data.
class-name=Test variable-name=aaa
So, the generate class should look like this.
public class Test { public String aaa; public void setVar(String str) { this.aaa = str; } public String getVar(){ return this.aaa; } }
When I was looking for a tool that I could use, I found Arch4j [1] interesting, but the problem is that it is not compatible with the Apache 2.0 license. I am looking for a project / tool compatible with the Apache 2.0 license.
I would appreciate it if someone can give me some idea of how I can do this.
[1] - http://arch4j.sourceforge.net/components/generator/index.html
source share