Menu

#9 allow to alter field name prefix

open
nobody
5
2011-11-02
2011-11-02
Anonymous
No

Beans generated using the BeanGenerator have their final field names prefixed with a string. This is because of a hard coded string in the method 'add_properties' of class EmitUtils. The prefix is always: '$cglib_prop_'

I came accross a situation where I needed to dynamically duplicate an object model and feed this into existing legacy application. The legacy code used some sort of reflection mechanism to access bean properties. I had to recompile cglib applying a fix which makes it possible to alter the fieldname prefix.

My solution is attached. The default value is '$cglib_prop_'. Applications which rely on this prefix will still work.

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.