I have method which gets a POJO as it's parameter. Now I want to programmatically get all the attributes of the POJO (because my code may not know what are all the attributes in it at run time) and need to get the values for the attributes also. Finally I'll form a string representation of the POJO.
I could use ToStringBuilder, but I want build my output string in certain format specific to my requirement.
Is it possible to do so in Beanutils !? If yes, any pointers to the method name? If no, should I write my own reflection code?