Search code examples
javaxmlruntimepojo

Create Java Pojo dynamically


How can I create Java Pojo at runtime? ASM or BCEL is required for this?

I am reading a XML file and I want to generate Pojo according to this xml.


Solution

  • There are lot of libraries available to generate classes in runtime. If you want to create a class and write it back to disk, BCEL and CGLIB is good. If you want most of them for runtime only, CGLIB is probably the best