Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#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


  • Anonymous
    2011-11-02

    sample solution

     
    Attachments

  • Anonymous
    2011-11-02

    • summary: allow to alter property name prefix --> allow to alter field name prefix