I am searching how to convert a HashMap to a Javabean. Looking how to create a bean (whose String attributes match with HashMap keys ) given bean class as input along with hashmap.

For e.g, I have hashmaps (key = value) as below-

attribute[name] = Joan
attribute[age] = 30

From this, I need generate the Bean with getter/setter methods for "name" & "age". Was going through org.apache.commons.beanutils. But I am not sure if I need to use DynaBean or BeanUtils class.

Anyone please help, thanks a lot..