what I needed seemed closer to what Hamed suggested.
I need the class to be generated and instantiated dynamically,
but some parts of this class should be static.
OK, let me tell you the scenario which is very simple and you might
have encountered that many times before.
suppose there is a table with n records (limited) and I'm implementing a submit form through a class definition which should produce TextFields, Checkboxes and ...for every record (dynamic section), there is also some EventHandling and blablabla for these fields (static section)
good to say that:
1- I'm not using any JSP's or scripts and I don't really think I need any POJOs (althogh helpful).
2- I'm using Hibernate but I really rather do this task independently (by only having the records count).
3- I also thouroughly revised java.lang.reflection but I didn't see any mean to declare them in runtime, but only to dynamically access the fields which was declared before.
4- I do not know Groovy and JRuby, and not planning to cover them by now, so changing the solution would be a safer faster way to reach the goal preferebly.