Your best guess will be a approach based on reflection.
The following libraries might be useful:
- Guava (https://code.google.com/p/guava-libraries/wiki/ReflectionExplained)
- Commons: Beanutils / Reflection (http://commons.apache.org/proper/commons-beanutils/)
- ASM