Hi,
I'am generating a java class on the fly using javassist. I would like to know how to add the piece of code given below.
private static final Hashtable myTable = new Hashtable();
static{
myTable.put("String","java.lang.String");
myTable.put("Integer","java.lang.Integer");
}
Thanks in advance,
Kumar Mathca.
You can use CtClass#makeClassInitializer()
and CtField#make(). Please look at javadoc.