Hi.

I need to create a bean class from list of properties in property file. So that if i need more fields in bean i don't need to go and change code. Instead just add a property in file and at runtime, a field with given name be added to the bean.

Its little bit urgent.

I have seen some of the options by searching but want to discuss it.
http://stackoverflow.com/questions/2320404/creating-classes-dynamically-with-java

It's impossible to do using standards methods because it's usually indicator (needing of byte-code mechanics ) of wrong application business logic ( Java will not compile code with callbacks for fields which does not exists anyway ).

If you really want to make it work, you must read about Javassist.

But I recommend you to look for another solution of this problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.